I\'m learning React and I have Eslint installed in my project. It started giving me errors like
Use callback in setState when referencing the previous state. (r
Destructuring is basically syntatic sugar Some Eslint configurations prefer it (which I'm guessing is your case).
It's basically declaring the values and making them equal to the bit of syntax you don't want to repeat, for Ex, given react props:
this.props.house, this.props.dog, this.props.car
destructured --->
const { house, dog, car } = this.props;
So now you can just use house, or dog or whatever you want. It's commonly used with states and props in react, here is more doc about it, hope it helps. https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Destructuring_assignment