Skip to content

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

Closed
wants to merge 5 commits into from
Closed

Conversation

Nilomiranda
Copy link

This fixes the issue #17736

@codesandbox-ci
Copy link

codesandbox-ci bot commented Dec 30, 2019

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:

Sandbox Source
shy-wave-zw6og Configuration

@sizebot
Copy link

sizebot commented Dec 30, 2019

No significant bundle size changes to report.

Size changes (stable)

Generated by 🚫 dangerJS against 33b963e

@sizebot
Copy link

sizebot commented Dec 30, 2019

No significant bundle size changes to report.

Size changes (experimental)

Generated by 🚫 dangerJS against 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`,
Copy link

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?

@bvaughn bvaughn requested a review from gaearon December 30, 2019 19:15
@stale
Copy link

stale bot commented Mar 30, 2020

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.

@stale stale bot added the Resolution: Stale Automatically closed due to inactivity label Mar 30, 2020
`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`,
Copy link
Collaborator

@gaearon gaearon Mar 30, 2020

Choose a reason for hiding this comment

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

  1. You need to add a space before this line.
  2. Change this to just React component names must start with an uppercase letter.

@stale stale bot removed the Resolution: Stale Automatically closed due to inactivity label Mar 30, 2020
Copy link
Collaborator

@gaearon gaearon left a 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.

@Nilomiranda
Copy link
Author

Closing this.

Already merged on #18881

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.

5 participants