score:1

I agree with Kenji's comment... You have to do that in ComponentDidMount...

https://reactjs.org/docs/state-and-lifecycle.html#adding-lifecycle-methods-to-a-class

and if you want to show a loading message you can set loading state and use that condition in render function like...

constructor(){
  this.state={loading:true}
}
ComponentDidMount(){
 //do your async thing and change the state to loading:false
}
render(){
   if(this.state.loading)
   return <YourMessage />

   return <Something />
}

Related Query

More Query from same tag