Skip to content

Commit

Permalink
Add React.StrictMode to default templates (#8558)
Browse files Browse the repository at this point in the history
Co-authored-by: Dan Abramov <dan.abramov@gmail.com>
  • Loading branch information
connkat and gaearon committed Mar 10, 2020
1 parent a452ddc commit 6adb82a
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
7 changes: 6 additions & 1 deletion packages/cra-template-typescript/template/src/index.tsx
Expand Up @@ -4,7 +4,12 @@ import './index.css';
import App from './App';
import * as serviceWorker from './serviceWorker';

ReactDOM.render(<App />, document.getElementById('root'));
ReactDOM.render(
<React.StrictMode>
<App />
</React.StrictMode>,
document.getElementById('root')
);

// If you want your app to work offline and load faster, you can change
// unregister() to register() below. Note this comes with some pitfalls.
Expand Down
7 changes: 6 additions & 1 deletion packages/cra-template/template/src/index.js
Expand Up @@ -4,7 +4,12 @@ import './index.css';
import App from './App';
import * as serviceWorker from './serviceWorker';

ReactDOM.render(<App />, document.getElementById('root'));
ReactDOM.render(
<React.StrictMode>
<App />
</React.StrictMode>,
document.getElementById('root')
);

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

0 comments on commit 6adb82a

Please sign in to comment.