I've added airbnb config for eslint that encourages prop and state destructuring, I like it, but stumbled across one problem when I define state in my component
class MyComponent extends Component {
state = {
animation: this.props.active ? 1 : 0
}
I get an error
[eslint] Must use destructuring props assignment (react/destructuring-assignment)
I'm not sure how can I correctly destructure active
out of props here?
Usually const {active} = this.props
works, but whenever I place it inside state or around it I get unexpected syntax error.