I have a JSON file that stored in state. Now I need to update a value in that file. When I use setState it doesn't save anything. this.state.data is an array that contains 4 objects. Where I'm doing a mistake?
this is my state:
constructor(props) {
super(props)
this.state = {
data: null,
}
}
Now I'm trying to save the value in data
this.setState({
[data[index].settings[idSettings].settings._init_[idMessageContent]
.message_content]: newValue,
})