Skip to content

Commit

Permalink
chore: use createRoot in react example
Browse files Browse the repository at this point in the history
  • Loading branch information
hannoeru committed Jun 25, 2022
1 parent 56aef3f commit 28646b3
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
7 changes: 4 additions & 3 deletions examples/react/src/main.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { StrictMode, Suspense } from 'react'
import ReactDOM from 'react-dom'
import { createRoot } from 'react-dom/client'
import {
BrowserRouter as Router,
useRoutes,
Expand All @@ -20,11 +20,12 @@ function App() {
)
}

ReactDOM.render(
const app = createRoot(document.getElementById('root')!)

app.render(
<StrictMode>
<Router>
<App />
</Router>
</StrictMode>,
document.getElementById('root'),
)
7 changes: 4 additions & 3 deletions examples/remix-style/src/main.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { StrictMode } from 'react'
import ReactDOM from 'react-dom'
import { createRoot } from 'react-dom/client'
import {
BrowserRouter as Router,
useRoutes,
Expand All @@ -16,11 +16,12 @@ function App() {
return useRoutes(routes)
}

ReactDOM.render(
const app = createRoot(document.getElementById('root')!)

app.render(
<StrictMode>
<Router>
<App />
</Router>
</StrictMode>,
document.getElementById('root'),
)

0 comments on commit 28646b3

Please sign in to comment.