I have to perform an operation in my code.This operation involves getting values from my state.In certain cases, my state returns the old value. Is there any function that can help me to trigger my code after all pending state transitions are complete?
save : function(){
//here am using state and it doesnt reflect new value
saveFunc(this.state.type);
}
You should use
shouldComponentUpdate()
read more here
So what you can do is:
Hope it helps.