-
Notifications
You must be signed in to change notification settings - Fork 46.7k
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
Move Hook mismatch warning to first mismatch site #14720
Conversation
4022317
to
d90134d
Compare
ReactDOM: size: 0.0%, gzip: 0.0% Details of bundled changes.Comparing: cb1ff43...abde12b react-dom
react-art
react-native-renderer
react-test-renderer
react-reconciler
Generated by 🚫 dangerJS |
Allows us to localize the warning logic in one place.
Rebased on master |
77f40ff
to
67892af
Compare
@@ -98,10 +98,6 @@ type HookType = | |||
| 'useImperativeHandle' | |||
| 'useDebugValue'; | |||
|
|||
// the first instance of a hook mismatch in a component, | |||
// represented by a portion of its stacktrace | |||
let currentHookMismatchInDev = null; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we were including the trace so peeps could tell which (possibly custom hook) was the offending one. fine to remove?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I suppose in this case the trace would be the stack of the warning itself?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
right, of course the warning would have its own trace. thanks!
* Move Hook mismatch warning to first mismatch site Allows us to localize the warning logic in one place. * Nit
Allows us to localize the warning logic in one place.