I have a problem with one of my React components. I think AJAX doesn\'t load all the content from external server before React renders the ChildComp component.<
ChildComp
Just do the AJAX call in componentDidMount() and in render you can simply check...
componentDidMount()
if(this.state.response === '' || this.state.response === [] || this.state.response === undefined) return else{ // do your stuff here }
OR if you are using react 16.6 or more, you can simply use lazy components.