Skip to content

Conversation

@fras2560
Copy link
Contributor

@fras2560 fras2560 commented Oct 9, 2025

Closes #324

@fras2560
Copy link
Contributor Author

fras2560 commented Oct 9, 2025

This change seems to address the issue I was running into.

I was not able to create a simplified repo but can do if you share a template to use for isolating the problem.

@fras2560
Copy link
Contributor Author

@fongandrew any help with maybe moving this forward?

@fongandrew
Copy link
Collaborator

For future me (or anyone else digging through this), this happens because of how React's <StrictMode> works in development:

When Strict Mode is on, React will also run one extra setup+cleanup cycle in development for every Effect. This may feel surprising, but it helps reveal subtle bugs that are hard to catch manually.

The expectation in prod is that an unmount is a real unmount (i.e. the class instance is discarded) but in dev with StrictMode, React is doing stuff to detect imperative side effects.

@fongandrew fongandrew merged commit d0b3c2c into scniro:master Oct 23, 2025
2 checks passed
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.

Bug: React Strictmode not hydrating properly

2 participants