-
Notifications
You must be signed in to change notification settings - Fork 49k
Closed
Labels
Description
React version: 16.3-16.13
Steps To Reproduce
- Render function component with side-effects and without hooks in StrictMode
- Component only renders once
Link to code example: https://codesandbox.io/s/strictmode-w-and-wo-hooks-vgxvh
The current behavior
StrictMode only renders function components with hooks twice following #15074 (comment)
The expected behavior
I think making the distinction between components with and without hooks causes more confusion than it helps. Especially since the docs do not mention this. I amended past efforts to improve the StrictMode docs but since this has been ignored I'm not sure this helps. I would also work on making the behavior consistent across all function component types if this is possible.
oliviertassinari and FgoPan