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

fix: adjust useMounted to work with strict effects #70

Merged
merged 1 commit into from
Mar 29, 2022

Conversation

golota60
Copy link
Contributor

@golota60 golota60 commented Mar 27, 2022

Fix for downsteam: react-bootstrap/react-bootstrap#6284 .

React 18 introduces a new StrictMode mount -> unmount -> mount pattern, which breaks useMounted in development and by extension useSafeState hook. I don't think there's a way to test this unfortunately(although if you've got any ideas let me know), but I've tested it locally and it fixes the issue that i've linked above.

@golota60
Copy link
Contributor Author

seems like codecovs broken

@kyletsang
Copy link
Collaborator

Nice fix! I think codecov's been broken for a while now.

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.

3 participants