constructor(props){
super(props)
this.state={
isLoading: true;
}
async componentDidMount(){
//invoke api
this.setState({isLoading:false})
}
}
render(){
const {isLoading} = this.state;
if (isLoading) {
return (
<div className={`spinner${isLoading ? "" : " d-none"}`}>
<Spinner fontSize={84} type="loading-3-quarters" />
</div>
);
}
return (
<React.Fragment>
...................
</React.Fragment>
}