Skip to content

Commit dda03e9

Browse files
committed
Created test
1 parent 2839b5d commit dda03e9

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

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

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1228,6 +1228,20 @@ ruleTester.run('no-unused-prop-types', rule, {
12281228
'}'
12291229
].join('\n'),
12301230
parser: 'babel-eslint'
1231+
}, {
1232+
// Destructured props in componentWillReceiveProps shouldn't throw errors when used createReactClass
1233+
code: [
1234+
'var Hello = createReactClass({',
1235+
' propTypes: {',
1236+
' something: PropTypes.bool,',
1237+
' },',
1238+
' componentWillReceiveProps (nextProps) {',
1239+
' const {something} = nextProps;',
1240+
' doSomething(something);',
1241+
' }',
1242+
'})'
1243+
].join('\n'),
1244+
parser: 'babel-eslint'
12311245
}, {
12321246
// Destructured function props in componentWillReceiveProps shouldn't throw errors
12331247
code: [

0 commit comments

Comments
 (0)