Closed
Description
class Foo extends React.Component {
constructor(props) {
super(props);
this.state = {
foo: props.foo // is reporting "[eslint] Unused state field: 'foo' [react/no-unused-state]"
};
}
static getDerivedStateFromProps(props, state) {
// am using state.foo
if (state.foo) {
return { bar: 123 };
}
return null;
}
}