Closed
Description
Website or app
https://codesandbox.io/s/react-devtools-useeffect-incorrect-render-reason-x3inwg
Repro steps
- Start profiling
- Click the button
- Stop profiling
- Check the reasons for rendering
It is incorrect to say that hook 2 is why this rendered. Hook 1 is why it rendered. Hook 2 was rescheduled during that render. These really need to be separated as they are completely different things. In a component with a lot of effects it can be tedious to find which hook was the one that caused it to render (especially with transpilling, minifying etc where hooks are not always shown nicely).
How often does this bug happen?
Every time
DevTools package (automated)
No response
DevTools version (automated)
No response
Error message (automated)
No response
Error call stack (automated)
No response
Error component stack (automated)
No response
GitHub query string (automated)
No response