Skip to content

Commit c14d100

Browse files
committed
Enable concurrent rendering with react-dom
1 parent f082828 commit c14d100

File tree

2 files changed

+7
-11
lines changed

2 files changed

+7
-11
lines changed

src/index.tsx

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,7 @@
1-
import React from 'react';
2-
import ReactDOM from 'react-dom';
3-
import './index.css';
4-
import App from './App';
5-
import * as serviceWorker from './serviceWorker';
1+
import React from "react";
2+
import ReactDOM from "react-dom";
3+
import "./index.css";
4+
import App from "./App";
65

7-
ReactDOM.render(<App />, document.getElementById('root'));
8-
9-
// If you want your app to work offline and load faster, you can change
10-
// unregister() to register() below. Note this comes with some pitfalls.
11-
// Learn more about service workers: https://bit.ly/CRA-PWA
12-
serviceWorker.unregister();
6+
const root = document.getElementById("root") as HTMLElement;
7+
ReactDOM.createRoot(root).render(<App />);

src/react-app-env.d.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
11
/// <reference types="react-scripts" />
2+
/// <reference types="react-dom/experimental" />

0 commit comments

Comments
 (0)