Skip to content

Commit

Permalink
Use createRoot from React DOM Client to instantiate the app
Browse files Browse the repository at this point in the history
  • Loading branch information
Pierre de la Martiniere committed May 13, 2022
1 parent 4b4fbd3 commit 443ec5f
Showing 1 changed file with 17 additions and 13 deletions.
30 changes: 17 additions & 13 deletions src/renderer/main.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
*/

import React from 'react';
import * as ReactDOM from 'react-dom';
import * as ReactDOM from 'react-dom/client';
import { Provider } from 'react-redux';
import { DndProvider } from 'react-dnd';
import { HTML5Backend } from 'react-dnd-html5-backend';
Expand All @@ -31,15 +31,19 @@ import './styles/main.module.css';
|--------------------------------------------------------------------------
*/

ReactDOM.render(
<React.StrictMode>
<Root>
<Provider store={store}>
<DndProvider backend={HTML5Backend}>
<Router />
</DndProvider>
</Provider>
</Root>
</React.StrictMode>,
document.getElementById('wrap')
);
const wrap = document.getElementById('wrap');

if (wrap) {
const root = ReactDOM.createRoot(wrap);
root.render(
<React.StrictMode>
<Root>
<Provider store={store}>
<DndProvider backend={HTML5Backend}>
<Router />
</DndProvider>
</Provider>
</Root>
</React.StrictMode>
);
}

0 comments on commit 443ec5f

Please sign in to comment.