Skip to content

Commit 6adb82a

Browse files
connkatgaearon
andauthoredMar 10, 2020
Add React.StrictMode to default templates (#8558)
Co-authored-by: Dan Abramov <dan.abramov@gmail.com>
1 parent a452ddc commit 6adb82a

File tree

2 files changed

+12
-2
lines changed
  • packages

2 files changed

+12
-2
lines changed
 

‎packages/cra-template-typescript/template/src/index.tsx

+6-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,12 @@ import './index.css';
44
import App from './App';
55
import * as serviceWorker from './serviceWorker';
66

7-
ReactDOM.render(<App />, document.getElementById('root'));
7+
ReactDOM.render(
8+
<React.StrictMode>
9+
<App />
10+
</React.StrictMode>,
11+
document.getElementById('root')
12+
);
813

914
// If you want your app to work offline and load faster, you can change
1015
// unregister() to register() below. Note this comes with some pitfalls.

‎packages/cra-template/template/src/index.js

+6-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,12 @@ import './index.css';
44
import App from './App';
55
import * as serviceWorker from './serviceWorker';
66

7-
ReactDOM.render(<App />, document.getElementById('root'));
7+
ReactDOM.render(
8+
<React.StrictMode>
9+
<App />
10+
</React.StrictMode>,
11+
document.getElementById('root')
12+
);
813

914
// If you want your app to work offline and load faster, you can change
1015
// unregister() to register() below. Note this comes with some pitfalls.

0 commit comments

Comments
 (0)
Please sign in to comment.