I have a 2D array and I need to update it in componentWillReceiveProps but it doesn't get updated.
This is my state;
this.state={
conditionRaw:[[]]
}
And this is componentWillReceiveProps method;
componentWillReceiveProps(nextProps){
let rules = {conditionRaw:[[]]};
if (nextProps.rootObject._id !== ""){
rules["conditionRaw"] = nextProps.rootObject.conditionRaw
this.setState({conditionRaw: rules.conditionRaw})
console.log("DENEMEBİRLKİ", this.state.conditionRaw)
}
}
My nextProps come filled but I reckon I'm failing at setState.