Skip to content

Commit 8c903c3

Browse files
authored
fix(useMultipleSelection): do not crash in react native (#1479)
1 parent e97c368 commit 8c903c3

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/hooks/useMultipleSelection/index.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import {useRef, useEffect, useCallback, useMemo} from 'react'
2+
import {isReactNative} from '../../is.macro'
23
import setStatus from '../../set-a11y-status'
34
import {handleRefs, callAllEventHandlers, normalizeArrowKey} from '../../utils'
45
import {
@@ -53,7 +54,7 @@ function useMultipleSelection(userProps = {}) {
5354
// Effects.
5455
/* Sets a11y status message on changes in selectedItem. */
5556
useEffect(() => {
56-
if (isInitialMountRef.current) {
57+
if (isInitialMountRef.current || isReactNative) {
5758
return
5859
}
5960

0 commit comments

Comments
 (0)