Skip to content

Conversation

@gaearon
Copy link
Collaborator

@gaearon gaearon commented Feb 1, 2019

  • Adds a link to https://reactjs.org/warnings/invalid-hook-call-warning.html for the invariant. (I guess it's not a warning.. but I also don't want to introduce a new URL naming scheme. We don't have separate pages for errors right now. We can move it later if it causes confusion but I'm not sure it would.)

  • Rewords the warning when we know more exactly what happened.

!isInHookUserCodeInDev,
'Hooks can only be called inside the body of a function component. ' +
'Do not call Hooks inside other Hooks. For more information, see ' +
'Do not call Hooks inside useEffect(...), useMemo(...), or other built-in Hooks. ' +
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice nice nice

@gaearon gaearon merged commit c21c41e into facebook:master Feb 1, 2019
NMinhNguyen referenced this pull request in enzymejs/react-shallow-renderer Jan 29, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants