-
Notifications
You must be signed in to change notification settings - Fork 47.2k
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
Fix the misleading error message in production #11761
Comments
What about this; Similar to it('should warn when given a string ref' test spec. |
I don't see a problem with that one. Do you? |
I wouldn't mind checking this if @extwiii does not want to. |
@skiritsis You got it! |
yenshih
pushed a commit
to yenshih/react
that referenced
this issue
Jan 6, 2018
…g ref to a functional component (facebook#11761) (facebook#11782) * Updated misleading error message in production environment when adding ref to a functional component * Reverted changes to codes.json * Updated error message
ManasJayanth
pushed a commit
to ManasJayanth/react
that referenced
this issue
Jan 12, 2018
…g ref to a functional component (facebook#11761) (facebook#11782) * Updated misleading error message in production environment when adding ref to a functional component * Reverted changes to codes.json * Updated error message
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
See this test case:
react/packages/react-dom/src/__tests__/ReactStatelessComponent-test.js
Lines 142 to 157 in 323efbc
Pretty sure the different message in production wasn't intentional, but is a consequence of
ReactCurrentOwner.current
not being set in production for functional components.We need to see if it's possible to emit the same (useful) message both in development in production. If it's not possible, we need to change the production message to be more ambiguous instead of suggesting the wrong reason for the problem.
The text was updated successfully, but these errors were encountered: