Skip to content

Commit ca0231a

Browse files
Update to react18 create root
1 parent b9b9c1b commit ca0231a

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

interface/src/index.tsx

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
import React from 'react';
2-
import ReactDOM from 'react-dom';
3-
2+
import { createRoot } from 'react-dom/client';
43
import { BrowserRouter } from 'react-router-dom';
54

65
import App from './App';
76

8-
ReactDOM.render(
7+
const container = document.getElementById('root');
8+
const root = createRoot(container!); // createRoot(container!) if you use TypeScript
9+
root.render(
910
<React.StrictMode>
1011
<BrowserRouter>
1112
<App />
1213
</BrowserRouter>
13-
</React.StrictMode>,
14-
document.getElementById('root')
15-
);
14+
</React.StrictMode>
15+
);

0 commit comments

Comments
 (0)