react-spring
react-spring copied to clipboard
[bug]: useReducedMotion: error on Safari < 14
Which react-spring target are you using?
- [X]
@react-spring/web - [ ]
@react-spring/three - [ ]
@react-spring/native - [ ]
@react-spring/konva - [ ]
@react-spring/zdog
What version of react-spring are you using?
9.7.3
What's Wrong?
The useReducedMotion hook calls MediaQueryList.addEventListener(), this causes an error in older Safari browsers- which are yet to have this function available.
To Reproduce
- Be on Safari 13.1 or lower
- Visit this url: https://codesandbox.io/s/eager-gould-hm3rtj?file=/src/App.tsx
- See the error
Expected Behaviour
Doesn't throw an error and also honours the (prefers-reduced-motion) media query.
Link to repo
https://codesandbox.io/s/eager-gould-hm3rtj?file=/src/App.tsx