Skip to content

Commit

Permalink
Add test for setState callback with no arguments.
Browse files Browse the repository at this point in the history
  • Loading branch information
barakyosi committed Feb 2, 2019
1 parent 24374b0 commit e8292fd
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions tests/lib/rules/no-unused-state.js
Original file line number Diff line number Diff line change
Expand Up @@ -704,6 +704,18 @@ eslintTester.run('no-unused-state', rule, {
}
`,
parser: 'babel-eslint'
}, {
// Don't error out
code: `
class Foo extends Component {
handleChange = function() {
this.setState(() => ({ foo: value }));
}
render() {
return <SomeComponent foo={this.state.foo} />;
}
}`,
parser: 'babel-eslint'
}, {
// Don't error out
code: `
Expand Down

0 comments on commit e8292fd

Please sign in to comment.