Skip to content

Commit fcb7b05

Browse files
committed
upgraded react and its types
1 parent 88e5734 commit fcb7b05

File tree

3 files changed

+2963
-44
lines changed

3 files changed

+2963
-44
lines changed

package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,8 @@
4545
"@testing-library/react": "^11.2.2",
4646
"@testing-library/user-event": "^13.0.7",
4747
"@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",
5050
"@typescript-eslint/eslint-plugin": "^4.8.2",
5151
"@typescript-eslint/parser": "^4.8.2",
5252
"eslint": "^7.14.0",
@@ -56,8 +56,8 @@
5656
"jest": "link:./test-projects/browser/node_modules/jest",
5757
"jest-ts-webcompat-resolver": "^1.0.0",
5858
"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",
6161
"react-test-renderer": "^17.0.1",
6262
"rugged": "^1.0.0",
6363
"ts-jest": "^26.5.4",

test-projects/browser/src/index.tsx

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,12 @@
11
// Imports
2-
import React from 'react';
3-
import ReactDOM from 'react-dom';
2+
import { createRoot } from 'react-dom/client';
43
import App from './app';
54

65
// 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 />);

0 commit comments

Comments
 (0)