diff --git a/README.md b/README.md index bdbcb111..ab4f626d 100644 --- a/README.md +++ b/README.md @@ -149,7 +149,7 @@ class MyComponent extends React.Component { Bar: null }; - componentWillMount() { + componentDidMount() { import('./components/Bar').then(Bar => { this.setState({ Bar }); }); diff --git a/src/index.js b/src/index.js index a22d69a7..f3a72710 100644 --- a/src/index.js +++ b/src/index.js @@ -149,7 +149,7 @@ function createLoadableComponent(loadFn, options) { return init(); } - componentWillMount() { + componentDidMount() { this._mounted = true; this._loadModule(); }