I have been told that whenever I am working with react state or changing it, I should make a clone or copy of it.
const cloneState = [...this.state]
cloneState.name = 'hardik'
But I am not sure why people recommend it, Why can't i directy change state?
why shouldn't I just do it using it
this.setState({name: 'hardik'})