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
function-component-definition should only test PascalCase identifiers #2778
Comments
While this is true, why would you have a function like this in the first place, that takes props and returns jsx and isn't named PascalCased? |
This would be a render function, which is passed to a component and gets called as part of the render phase |
Render functions don't take props. |
They might, and in #2771 the examples actually do |
They take arguments - props are only taken by elements/components. |
...ok, but they are indistinguishable in code? function Foo({bar}) { return <span>{bar}</span/> }
function renderFoo({bar}) { return <span>{bar}</span/> } |
Nope :-) but conceptually they're distinct, and you named your argument "props" which is a signal that it's a component, as is, taking a single destructured object argument - render props usually take multiple flat arguments. |
This seems answered; if not, we can reopen. |
Should not be changed by function-component-definition.
The text was updated successfully, but these errors were encountered: