Skip to content

Commit

Permalink
feat: Disable React.StrictMode on production
Browse files Browse the repository at this point in the history
  • Loading branch information
stepkos committed Oct 14, 2024
1 parent fdec500 commit 968ae2f
Showing 1 changed file with 13 additions and 5 deletions.
18 changes: 13 additions & 5 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,19 @@ import App from './App';
import reportWebVitals from './reportWebVitals';

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

if (process.env.NODE_ENV === 'production') {
root.render(
<App />
);
}
else {
root.render(
<React.StrictMode>
<App />
</React.StrictMode>
);
}

// If you want to start measuring performance in your app, pass a function
// to log results (for example: reportWebVitals(console.log))
Expand Down

0 comments on commit 968ae2f

Please sign in to comment.