Skip to content

Commit 2cac2e8

Browse files
committed
[Tests] no-unused-prop-types: add passing test
Closes #1477
1 parent f40f88e commit 2cac2e8

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

tests/lib/rules/no-unused-prop-types.js

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3859,6 +3859,29 @@ ruleTester.run('no-unused-prop-types', rule, {
38593859
`,
38603860
features: ['types'],
38613861
},
3862+
{
3863+
code: `
3864+
import React from 'react';
3865+
3866+
type Props = {
3867+
test: string,
3868+
callback: () => void,
3869+
};
3870+
3871+
export default function Foo(props: Props) {
3872+
return (
3873+
<div>
3874+
{[1, 2, 3].map(e => (
3875+
<div key={e} onClick={() => props.callback()}>
3876+
{props.test}
3877+
</div>
3878+
))}
3879+
</div>
3880+
);
3881+
}
3882+
`,
3883+
features: ['types'],
3884+
},
38623885
]),
38633886

38643887
invalid: parsers.all([].concat(

0 commit comments

Comments
 (0)