Skip to content

Added a wrapper over mediaQueryList to work around Safari bug #101

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

Merged
merged 2 commits into from
Sep 25, 2018

Conversation

yiochen
Copy link
Contributor

@yiochen yiochen commented Sep 25, 2018

As described in #100. Safari behaves differently from Chrome and other browsers in that a listener might still get called after we remove it. This caused setState to trigger after ReactMedia is unmounted.

Added a wrapper over mediaQueryList to prevent triggering listener after we remove it.

@edorivai edorivai merged commit f2a250d into ReactTraining:master Sep 25, 2018
@edorivai
Copy link
Collaborator

Thanks @yiochen!

@gersomvg
Copy link

Awesome! I had it on my todo list for later this week :)

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

Successfully merging this pull request may close these issues.

3 participants