Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[bug]: useReducedMotion: error on Safari < 14 #2299

Closed
1 of 5 tasks
BenHodgsonR2R opened this issue Jul 1, 2024 · 0 comments · Fixed by #2300
Closed
1 of 5 tasks

[bug]: useReducedMotion: error on Safari < 14 #2299

BenHodgsonR2R opened this issue Jul 1, 2024 · 0 comments · Fixed by #2300
Labels
template: bug This issue might be a bug

Comments

@BenHodgsonR2R
Copy link
Contributor

Which react-spring target are you using?

  • @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

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
template: bug This issue might be a bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant