-  
-   Notifications  You must be signed in to change notification settings 
- Fork 2.7k
Closed
Labels
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; } }