Skip to content

Commit

Permalink
chore(index): use createRoot from react18
Browse files Browse the repository at this point in the history
  • Loading branch information
nurikk committed Nov 19, 2023
1 parent bf280ff commit 1213a79
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import './styles/styles.global.scss';
import { NotificationContainer } from 'react-notifications';
import React, { FunctionComponent } from 'react';
import NiceModal from '@ebay/nice-modal-react';
import { createRoot } from 'react-dom/client';

import ConnectedMap from './components/map';

Expand All @@ -23,7 +24,6 @@ import ConnectedGroupsPage from './components/groups';
import ConnectedZigbeePage from './components/zigbee';
import LogsPage from './components/logs-page';
import OtaPage from './components/ota-page';
import ReactDOM from 'react-dom';
import ErrorBoundary from './components/ErrorBoundary';
import DashboardPage from './components/dashboard-page';
import ExtensionsEditorPage from './components/extensions-editor';
Expand Down Expand Up @@ -161,4 +161,9 @@ const Main = () => {
);
};

ReactDOM.render(<Main />, document.getElementById('root'));

const domNode = document.getElementById('root');
if (domNode) {
createRoot(domNode).render(<Main />);
}

0 comments on commit 1213a79

Please sign in to comment.