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

Issue when using Rocket-jump and Masonry in Strictmode in React 18 #2

Open
frederic-reis opened this issue Sep 5, 2023 · 2 comments

Comments

@frederic-reis
Copy link
Contributor

With rocket-jump 2.6, there is a runtime error

image

With rocjet-jump 3, no runtime error but strange behaviour with Masonry component when you scroll quickly

image

image

@frederic-reis
Copy link
Contributor Author

In React 17 and 18, Strictmode renders components twice
In React 18, Strictmode gets an additional behavior to ensure it's compatible with reusable state. When Strict Mode is enabled, React intentionally double-invokes effects (mount -> unmount -> mount) for newly mounted components.

See: https://stackoverflow.com/questions/72112028/does-strict-mode-work-differently-with-react-18

@frederic-reis
Copy link
Contributor Author

Strictmode causes issues on mapbox too. The points and lines are not displayed

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

No branches or pull requests

1 participant