Skip to content

Commit

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

Expand Down

0 comments on commit 1b307d3

Please sign in to comment.