-
-
Notifications
You must be signed in to change notification settings - Fork 32.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[examples] Update to use React 18's createRoot (#32506)
- Loading branch information
Showing
10 changed files
with
64 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,17 @@ | ||
import * as React from 'react'; | ||
import ReactDOM from 'react-dom'; | ||
import { createRoot } from 'react-dom/client'; | ||
import CssBaseline from '@mui/material/CssBaseline'; | ||
import { ThemeProvider } from '@mui/material/styles'; | ||
import App from './App'; | ||
import theme from './theme'; | ||
|
||
ReactDOM.render( | ||
const rootElement = document.getElementById('root'); | ||
const root = createRoot(rootElement!); | ||
|
||
root.render( | ||
<ThemeProvider theme={theme}> | ||
{/* CssBaseline kickstart an elegant, consistent, and simple baseline to build upon. */} | ||
<CssBaseline /> | ||
<App /> | ||
</ThemeProvider>, | ||
document.querySelector('#root'), | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,17 @@ | ||
import * as React from 'react'; | ||
import ReactDOM from 'react-dom'; | ||
import { createRoot } from 'react-dom/client'; | ||
import CssBaseline from '@mui/material/CssBaseline'; | ||
import { ThemeProvider } from '@mui/material/styles'; | ||
import App from './App'; | ||
import theme from './theme'; | ||
|
||
ReactDOM.render( | ||
const rootElement = document.getElementById('root'); | ||
const root = createRoot(rootElement); | ||
|
||
root.render( | ||
<ThemeProvider theme={theme}> | ||
{/* CssBaseline kickstart an elegant, consistent, and simple baseline to build upon. */} | ||
<CssBaseline /> | ||
<App /> | ||
</ThemeProvider>, | ||
document.querySelector('#root'), | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,8 @@ | ||
import * as React from 'react'; | ||
import ReactDOM from 'react-dom'; | ||
import { createRoot } from 'react-dom/client'; | ||
import App from './App'; | ||
|
||
ReactDOM.render(<App />, document.querySelector('#root')); | ||
const rootElement = document.getElementById('root'); | ||
const root = createRoot(rootElement!); | ||
|
||
root.render(<App />); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters