Skip to content

Commit

Permalink
disable strict mode that caused useEffect to be called twice
Browse files Browse the repository at this point in the history
  • Loading branch information
Amy Chen authored and Amy Chen committed Jul 28, 2022
1 parent 874d346 commit c01de6d
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,10 @@ import App from './components/App';

const root = ReactDOM.createRoot(document.getElementById('root'));
root.render(
<React.StrictMode>
<App />
</React.StrictMode>
// turn strict mode off as it causes useEffect to be called twice,
// see issue https://github.com/facebook/react/issues/24455
// <React.StrictMode>
<App />
// </React.StrictMode>
);

0 comments on commit c01de6d

Please sign in to comment.