File tree Expand file tree Collapse file tree 2 files changed +20
-8
lines changed
packages/react-integration/demo-app-ts/src Expand file tree Collapse file tree 2 files changed +20
-8
lines changed Original file line number Diff line number Diff line change 1
- import React from 'react' ;
2
- import ReactDOM from 'react-dom' ;
1
+ import React , { StrictMode } from 'react' ;
2
+ import { createRoot } from 'react-dom/client ' ;
3
3
import App from './App' ;
4
4
5
5
it ( 'renders without crashing' , ( ) => {
6
- const div = document . createElement ( 'div' ) ;
7
- ReactDOM . render ( < App /> , div ) ;
8
- ReactDOM . unmountComponentAtNode ( div ) ;
6
+ const container = document . createElement ( 'div' ) ;
7
+ const root = createRoot ( container ) ;
8
+ root . render (
9
+ < StrictMode >
10
+ < App />
11
+ </ StrictMode >
12
+ ) ;
13
+ root . unmount ( ) ;
9
14
} ) ;
Original file line number Diff line number Diff line change 1
1
import '@patternfly/react-core/dist/styles/base.css' ;
2
- import React from 'react' ;
3
- import ReactDOM from 'react-dom' ;
2
+ import React , { StrictMode } from 'react' ;
3
+ import { createRoot } from 'react-dom/client ' ;
4
4
import './index.css' ;
5
5
import App from './App' ;
6
6
import '@patternfly/patternfly/patternfly-theme-dark.css' ;
7
7
8
- ReactDOM . render ( < App /> , document . getElementById ( 'root' ) ) ;
8
+ const container = document . getElementById ( 'root' ) ;
9
+ const root = createRoot ( container ) ;
10
+
11
+ root . render (
12
+ < StrictMode >
13
+ < App />
14
+ </ StrictMode >
15
+ ) ;
You can’t perform that action at this time.
0 commit comments