File tree Expand file tree Collapse file tree 3 files changed +2963
-44
lines changed
test-projects/browser/src Expand file tree Collapse file tree 3 files changed +2963
-44
lines changed Original file line number Diff line number Diff line change 45
45
"@testing-library/react" : " ^11.2.2" ,
46
46
"@testing-library/user-event" : " ^13.0.7" ,
47
47
"@types/jest" : " ^26.0.3" ,
48
- "@types/react" : " ^17 .0.0 " ,
49
- "@types/react-dom" : " ^17 .0.3 " ,
48
+ "@types/react" : " ^18 .0.17 " ,
49
+ "@types/react-dom" : " ^18 .0.6 " ,
50
50
"@typescript-eslint/eslint-plugin" : " ^4.8.2" ,
51
51
"@typescript-eslint/parser" : " ^4.8.2" ,
52
52
"eslint" : " ^7.14.0" ,
56
56
"jest" : " link:./test-projects/browser/node_modules/jest" ,
57
57
"jest-ts-webcompat-resolver" : " ^1.0.0" ,
58
58
"prettier" : " ^2.0.2" ,
59
- "react" : " ^17.0.2 " ,
60
- "react-dom" : " ^17.0.2 " ,
59
+ "react" : " ^18.2.0 " ,
60
+ "react-dom" : " ^18.2.0 " ,
61
61
"react-test-renderer" : " ^17.0.1" ,
62
62
"rugged" : " ^1.0.0" ,
63
63
"ts-jest" : " ^26.5.4" ,
Original file line number Diff line number Diff line change 1
1
// Imports
2
- import React from 'react' ;
3
- import ReactDOM from 'react-dom' ;
2
+ import { createRoot } from 'react-dom/client' ;
4
3
import App from './app' ;
5
4
6
5
// Render
7
- ReactDOM . render ( < App /> , document . getElementById ( 'root' ) ) ;
6
+ const rootElement = document . getElementById ( 'root' ) ;
7
+
8
+ if ( ! rootElement ) {
9
+ throw new Error ( 'Root element should be present' ) ;
10
+ }
11
+
12
+ createRoot ( rootElement ) . render ( < App /> ) ;
You can’t perform that action at this time.
0 commit comments