Skip to content

Commit

Permalink
📝 add an important detail for react's doc (#2178)
Browse files Browse the repository at this point in the history
  • Loading branch information
ygcedu authored Sep 26, 2022
1 parent 7d0116c commit 426b0dd
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions docs/guide/tutorial.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
1 change: 1 addition & 0 deletions docs/guide/tutorial.zh.md
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,7 @@ start();
ReactDOM.unmountComponentAtNode(container ? container.querySelector('#root') : document.querySelector('#root'));
}
```
这里需要特别注意的是,通过 ReactDOM.render 挂载子应用时,需要保证每次子应用加载都应使用一个新的路由实例。

4. 修改 `webpack` 配置

Expand Down

1 comment on commit 426b0dd

@vercel
Copy link

@vercel vercel bot commented on 426b0dd Sep 26, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.