-
Notifications
You must be signed in to change notification settings - Fork 164
Updates for React.StrictMode compliance #205
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice! Thanks a lot.
Thanks very much for doing this. However two tests are failing. |
Awesome, thanks @shoeman22! @allcontributors, please add @shoeman22 for code. |
I've put up a pull request to add @shoeman22! 🎉 |
@mrbinky3000 @bcarroll22 ok, I updated the CarouselProvider to accommodate test properly. Sorry for the noise in the commits -- I'd pushed to my own fork with Thanks for the shoutout on the contributors as well! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll wait for @mrbinky3000 to give the final approval before merging, but looks good to me 👍
@allcontributors, please add @shoeman22 for code. |
I've updated the pull request to add @shoeman22! 🎉 |
🎉 This PR is included in version 1.24.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
What:
When used within a
<React.StrictMode />
block, this library was generating warnings since it was using the Legacy Context API. This PR updatesCarouselProvider
andWithStore
to use the New Context API as recommended by react.There was also another strict mode warning with regard to using setState firing on an unmounted component, so I moved the subscribe step in the
Wrapper
component inWithStore
tocomponentDidMount()
to correct this warning.Why:
I want to try out Concurrent Mode and the React team recommends making sure your app works without warnings when in Strict Mode before giving it a go. This library was the last hiccup I needed to solve to be warning free.
How:
I forked the repo and made the changes.
Checklist:
Loving the library so far. Great work!