Skip to content

Commit 96729bd

Browse files
LordThitimdorr
andauthored
docs(Browser-router.md): Update for React 18.0 (#9953)
Co-authored-by: Tim Dorr <[email protected]>
1 parent 3a44ce3 commit 96729bd

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

contributors.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -169,3 +169,4 @@
169169
- xavier-lc
170170
- xcsnowcity
171171
- yuleicul
172+
- LordThi

docs/router-components/browser-router.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,14 +27,15 @@ A `<BrowserRouter>` stores the current location in the browser's address bar usi
2727

2828
```tsx
2929
import * as React from "react";
30-
import * as ReactDOM from "react-dom";
30+
import { createRoot } from 'react-dom/client';
3131
import { BrowserRouter } from "react-router-dom";
3232

33-
ReactDOM.render(
33+
const root = createRoot(document.getElementById('root'));
34+
35+
root.render(
3436
<BrowserRouter>
3537
{/* The rest of your app goes here */}
36-
</BrowserRouter>,
37-
root
38+
</BrowserRouter>
3839
);
3940
```
4041

0 commit comments

Comments
 (0)