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
react/prop-types
false positive with local variable props
#1288
Labels
Comments
Worth fixing, but I have no idea why you'd ever want a variable called "props" in a React component :-) |
@ljharb FYI function GenericThankyou({ nextAssignmentId }) {
const cardProps = {}
if (nextAssignmentId == null) {
cardProps.submitText = 'Back to the lobby'
cardProps.onSubmit = navigateTo(RailsRoutes.lobby_path())
} else {
cardProps.submitText = 'Take the next test'
cardProps.onSubmit = navigateTo(RailsRoutes.do_ordered_test_path(nextAssignmentId))
}
return (
<TestStepCard {...cardProps}>
<Title>{translate('test.complete.thank_you_1')}</Title>
<p className='GenericThankyou-text'>
{translate('test.complete.message_1')}
</p>
</TestStepCard>
)
} |
( |
(agreed, but I decided to report it anyway) |
Fixed in #1365 |
This was referenced Sep 22, 2018
This was referenced Oct 25, 2018
1 task
1 task
1 task
This was referenced Jan 8, 2019
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Apparently a local variable called
props
will be incorrectly considered to be passed props in a functional component.Following is fine:
The text was updated successfully, but these errors were encountered: