When working with a component's state, clone the state while assigning it to a new variable.
ex.
letitem=this.state.item;// (No)letitem={...this.state.item};// (Do this instead)letitem=[...this.state.items]// (Or do this if it's an array)
Ran into issues, especially in multi-person teams, where we'd forget that item references the component's state. item would later get reassigned, or properties get changed, and then component's state is mutated!
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
When working with a component's state, clone the state while assigning it to a new variable.
ex.
Ran into issues, especially in multi-person teams, where we'd forget that
item
references the component's state.item
would later get reassigned, or properties get changed, and then component's state is mutated!