вот довольно симпатичный костыль:
import React, { Component } from 'react';
import logo from './logo.svg';
import './App.css';
class App extends Component {
// fake authentication Promise
authenticate(){
return new Promise(resolve => setTimeout(resolve, 2000))
}
componentDidMount(){
this.authenticate().then(() => {
const ele = document.getElementById('ipl-progress-indicator')
if(ele){
// fade out
ele.classList.add('available')
setTimeout(() => {
// remove from DOM
ele.outerHTML = ''
}, 2000)
}
})
}
render() {
return (
<div className="App">
<div className="App-header">
<img src={logo} className="App-logo" alt="logo" />
<h2>Welcome to React</h2>
</div>
<p className="App-intro">
To get started, edit <code>src/App.js</code> and save to reload.
</p>
</div>
);
}
}
export default App;
https://github.com/nguyenbathanh/react-loading-scr...