[DevTools]: Confusing "Why did this render?" with hooks #23114
Labels
Component: Developer Tools
Status: Unconfirmed
A potential issue that we haven't yet confirmed as a bug
Type: Bug
Website or app
https://codesandbox.io/s/elegant-paper-5lhxd?file=/src/App.js
Repro steps
Problem
The list of hooks that were changed is correct. However, this list is not really the reason why this component has been rendered. The only thing that changed and led to this rerender is the context value.
I think the list of changed hooks is useful but this should be listed separately. For the "Why did this render?" only context and state (and maybe useSyncExternalStore snapshots) should be listed. As only those actually cause rerenders.
On a separate note - it's a bummer that contexts are not counted within the changed hooks list and the only report we get is that "context has changed". If I use multiple contexts in a component this information is often not enough because I can't easily check which context has been updated.
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
The text was updated successfully, but these errors were encountered: