I have an synchronization issue. I want to check props is loaded or not to child component. I have wrote a code like that :
componentDidMount() {
setTimeout(() => {
this.setState({
editorContent: this.props.json[this.state.contentType],
});
}, 2500);
}
Here I'm using 'setTimeout' function. In render function I'm using 'editorContent' state so this is undefined if I don't use 'setTimeout'. After 1 or 2 sec. props received and it won't be undefined. I guess there is better solution for that. Thanks all