📝 add an important detail for react's doc (#2178)

This commit is contained in:
Fendi 2022-09-26 22:12:39 +08:00 committed by GitHub
parent 7d0116c322
commit 426b0dd674
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 0 deletions

View File

@ -112,6 +112,7 @@ Take the `react 16` project generated by `create react app` as an example, with
ReactDOM.unmountComponentAtNode(container ? container.querySelector('#root') : document.querySelector('#root'));
}
```
It's important, When mount a sub-application through ReactDOM.render, need to ensure each sub-application load with a new router instance.
4. Modify `webpack` configuration

View File

@ -112,6 +112,7 @@ start();
ReactDOM.unmountComponentAtNode(container ? container.querySelector('#root') : document.querySelector('#root'));
}
```
这里需要特别注意的是,通过 ReactDOM.render 挂载子应用时,需要保证每次子应用加载都应使用一个新的路由实例。
4. 修改 `webpack` 配置