-
Notifications
You must be signed in to change notification settings - Fork 49k
More clear hooks warning for why a function is not considered as a component #17744
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
Conversation
…not recognized as a React component
This pull request is automatically built and testable in CodeSandbox. To see build info of the built libraries, click here or the icon next to each commit SHA. Latest deployment of this branch, based on commit 33b963e:
|
`function "${fn}" ` + | ||
'that is neither a React function component nor a custom ' + | ||
'React Hook function.' + | ||
`If you are using ${hook} inside a functional component, make sure the function name starts with an uppercase letter`, |
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.
Maybe wrap ${hook}
in double quotes so it's consistent with the rest of the message?
This pull request has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contribution. |
`function "${fn}" ` + | ||
'that is neither a React function component nor a custom ' + | ||
'React Hook function.' + | ||
`If you are using "${hook}" inside a functional component, make sure the function name starts with an uppercase letter`, |
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.
- You need to add a space before this line.
- Change this to just
React component names must start with an uppercase letter.
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.
Please see above comment.
Closing this. Already merged on #18881 |
This fixes the issue #17736