Skip to content

Commit

Permalink
fix createRoot for React 18
Browse files Browse the repository at this point in the history
  • Loading branch information
mxschmitt committed May 25, 2022
1 parent 1eec83b commit 7016ce5
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 6 deletions.
10 changes: 6 additions & 4 deletions create-react-app-coverage/src/index.tsx
@@ -1,11 +1,13 @@
import React from 'react';
import ReactDOM from 'react-dom';
import ReactDOM from 'react-dom/client';
import './index.css';
import App from './App';

ReactDOM.render(
const root = ReactDOM.createRoot(
document.getElementById('root') as HTMLElement
);
root.render(
<React.StrictMode>
<App />
</React.StrictMode>,
document.getElementById('root')
</React.StrictMode>
);
1 change: 1 addition & 0 deletions create-react-app/jest-playwright.config.js
Expand Up @@ -4,6 +4,7 @@ module.exports = {
serverOptions: {
command: `npm start`,
port: 3000,
protocol: 'http',
launchTimeout: 10000,
debug: true,
},
Expand Down
11 changes: 9 additions & 2 deletions create-react-app/src/index.tsx
@@ -1,6 +1,13 @@
import React from 'react';
import ReactDOM from 'react-dom';
import ReactDOM from 'react-dom/client';
import './index.css';
import App from './App';

ReactDOM.render(<App />, document.getElementById('root'));
const root = ReactDOM.createRoot(
document.getElementById('root') as HTMLElement
);
root.render(
<React.StrictMode>
<App />
</React.StrictMode>
);

0 comments on commit 7016ce5

Please sign in to comment.