Skip to content

Conversation

@niallpaterson
Copy link

This pull request fixes #8

It should no longer cause crashing in safari <= 13

Safari 14 implements both the addListener and addEventListener apis, so we only use the older addListener if the browser has addListener but not addEventListener.

Thanks!

// If only has depreciated api use that, otherwise use current api
// Safari 14 + has both, Safari <= 13 only has depreciated
// fixes https://github.com/infiniteluke/react-reduce-motion/issues/8
const usesDepreciatedApi = mq.addListener && !mq.addEventListener;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

depreciated or deprecated?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mitchellwarr Golly I've been saying that wrong a while! Thanks! 🙈 ❤️

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Doesn't work in Safari <13

2 participants