File tree Expand file tree Collapse file tree 2 files changed +10
-8
lines changed
cra-template-typescript/template/src
cra-template/template/src Expand file tree Collapse file tree 2 files changed +10
-8
lines changed Original file line number Diff line number Diff line change 1
1
import React from 'react' ;
2
- import ReactDOM from 'react-dom' ;
2
+ import ReactDOM from 'react-dom/client ' ;
3
3
import './index.css' ;
4
4
import App from './App' ;
5
5
import reportWebVitals from './reportWebVitals' ;
6
6
7
- ReactDOM . render (
7
+ const root = ReactDOM . createRoot (
8
+ document . getElementById ( 'root' ) as HTMLElement
9
+ ) ;
10
+ root . render (
8
11
< React . StrictMode >
9
12
< App />
10
- </ React . StrictMode > ,
11
- document . getElementById ( 'root' )
13
+ </ React . StrictMode >
12
14
) ;
13
15
14
16
// If you want to start measuring performance in your app, pass a function
Original file line number Diff line number Diff line change 1
1
import React from 'react' ;
2
- import ReactDOM from 'react-dom' ;
2
+ import ReactDOM from 'react-dom/client ' ;
3
3
import './index.css' ;
4
4
import App from './App' ;
5
5
import reportWebVitals from './reportWebVitals' ;
6
6
7
- ReactDOM . render (
7
+ const root = ReactDOM . createRoot ( document . getElementById ( 'root' ) ) ;
8
+ root . render (
8
9
< React . StrictMode >
9
10
< App />
10
- </ React . StrictMode > ,
11
- document . getElementById ( 'root' )
11
+ </ React . StrictMode >
12
12
) ;
13
13
14
14
// If you want to start measuring performance in your app, pass a function
You can’t perform that action at this time.
0 commit comments