Skip to content

Commit

Permalink
docs: change setup example to react 18
Browse files Browse the repository at this point in the history
closes: #422
  • Loading branch information
hannoeru committed Mar 26, 2024
1 parent 4246c7c commit 416d4bd
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 10 deletions.
18 changes: 11 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -94,9 +94,10 @@ const router = createRouter({
**experimental**

```jsx
import { Suspense } from 'react'
import { StrictMode, Suspense } from 'react'
import { createRoot } from 'react-dom/client'
import {
BrowserRouter as Router,
BrowserRouter,
useRoutes,
} from 'react-router-dom'

Expand All @@ -110,11 +111,14 @@ function App() {
)
}

ReactDOM.render(
<Router>
<App />
</Router>,
document.getElementById('root'),
const app = createRoot(document.getElementById('root')!)

app.render(
<StrictMode>
<BrowserRouter>
<App />
</BrowserRouter>
</StrictMode>,
)
```

Expand Down
6 changes: 3 additions & 3 deletions examples/react/src/main.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { StrictMode, Suspense } from 'react'
import { createRoot } from 'react-dom/client'
import {
BrowserRouter as Router,
BrowserRouter,
useRoutes,
} from 'react-router-dom'

Expand All @@ -24,8 +24,8 @@ const app = createRoot(document.getElementById('root')!)

app.render(
<StrictMode>
<Router>
<BrowserRouter>
<App />
</Router>
</BrowserRouter>
</StrictMode>,
)

0 comments on commit 416d4bd

Please sign in to comment.