Implement prefersReducedMotion on native (#4039)
* implement prefersReducedMotion on native * just take the function from the reanimated source * use patch-package to export internal function
This commit is contained in:
parent
3674c8abce
commit
aded49f65b
2 changed files with 32 additions and 4 deletions
|
@ -1,4 +1,5 @@
|
|||
import {Platform} from 'react-native'
|
||||
import {isReducedMotion} from 'react-native-reanimated'
|
||||
import {getLocales} from 'expo-localization'
|
||||
|
||||
import {dedupArray} from 'lib/functions'
|
||||
|
@ -20,7 +21,4 @@ export const deviceLocales = dedupArray(
|
|||
.filter(code => typeof code === 'string'),
|
||||
) as string[]
|
||||
|
||||
export const prefersReducedMotion =
|
||||
isWeb &&
|
||||
// @ts-ignore we know window exists -prf
|
||||
!global.window.matchMedia('(prefers-reduced-motion: no-preference)')?.matches
|
||||
export const prefersReducedMotion = isReducedMotion()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue