Skip to content

Commit

Permalink
Migrate to the React 18 new root API
Browse files Browse the repository at this point in the history
  • Loading branch information
pokusew committed Apr 15, 2023
1 parent 2228516 commit 1876b75
Showing 1 changed file with 4 additions and 12 deletions.
16 changes: 4 additions & 12 deletions app/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,7 @@

import React from 'react';

// see https://github.com/welldone-software/why-did-you-render
// if (process.env.NODE_ENV === 'development') {
// const whyDidYouRender = require('@welldone-software/why-did-you-render');
// whyDidYouRender(React, {
// trackAllPureComponents: true,
// });
// }
import { render } from 'react-dom';
import { createRoot } from 'react-dom/client';

import Root from './containers/Root';
import { routesMap } from './routes';
Expand Down Expand Up @@ -42,10 +35,9 @@ const firebase = configureFirebase();

const router = new Router(routesMap);

render(
<Root store={store} firebase={firebase} router={router} />,
document.getElementById('root'),
);
const container = document.getElementById('root');
const root = createRoot(container!);
root.render(<Root store={store} firebase={firebase} router={router} />);
//
// // @ts-ignore
// if (module.hot) {
Expand Down

0 comments on commit 1876b75

Please sign in to comment.