-
Notifications
You must be signed in to change notification settings - Fork 47k
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
Double-render function components in DEV in StrictMode #14639
Conversation
ReactDOM: size: 0.0%, gzip: 0.0% Details of bundled changes.Comparing: 10a7a5b...f836352 react-dom
react-art
react-native-renderer
react-test-renderer
react-reconciler
Generated by 🚫 dangerJS |
TestRenderer is built with strict mode doublerender off. We could change that but I'm not sure we want to. So I'll just flip the flag off for this test.
This change might be observable in a way that breaks existing tests (e.g. if I mock a module/component and then assert on the number of renders). Not sure how common this is, and also– I think this change might still be the right thing to do in a minor. Just seemed worth considering. |
We can do that but for now I'll go with #14643 instead |
@acdlite noticed we're not doing this, but we should. It's DEV-only. Function components already need to not have observable side effects — so I think this is perfectly reasonable to do in a minor.
The test changes are a bit wonky. Maybe we could abstract this away but I felt it's only a few files for now and not too bad.