Skip to content

Commit

Permalink
[Tests] prop-types: add passing test
Browse files Browse the repository at this point in the history
Closes #2196
  • Loading branch information
ljharb committed Feb 18, 2022
1 parent 0a57e3d commit a34a232
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions tests/lib/rules/prop-types.js
Expand Up @@ -3825,6 +3825,21 @@ ruleTester.run('prop-types', rule, {
name: PropTypes.string.isRequired,
};
`,
},
{
code: `
const SomeComponent = (props) => {
function renderComponent() {
return <div>{props.name}</div>
}
return renderComponent();
}
SomeComponent.propTypes = {
name: PropTypes.string
}
`,
}
)),

Expand Down

0 comments on commit a34a232

Please sign in to comment.