faceyspacey / faceyspacey/react-universal-component
How to check that the component has loaded?
Open
- Dominant language
- JavaScript
- Stars
- 1.7k
- Forks
- 80
- PR merge metrics
- No merged PRs in 30d
Description
What is the best way to detect that the `DoThis` has loaded?
```
const DoThis = universal(import(/* webpackChunkName: 'do-this' */ 'src/do-this.js'));
class DoThisLoader extends React.Component {
constructor() {
super();
this.state = {
dataLoaded: false,
};
}
componentWillMount() {
DoThis.preload();
}
componentDidMount() {
loadSomeData().then(() => this.setState({ dataLoaded: true }));
}
render() {
return dataLoaded && DoThis ? : ;
}
}
```
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.