Skip to content

Commit

Permalink
Remove strict mode for testing abort controller cleanup inside useEffect
Browse files Browse the repository at this point in the history
  • Loading branch information
madhavms committed May 10, 2023
1 parent a2bc4a2 commit 6ebb02d
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,14 @@ const renderApp = () => (
</BrowserRouter>
);

if (process.env.NODE_ENV === "development") {
/*
TODO: Need to revert to development to enable React Strict Mode
once testing done for AbortController in useEmployee.tsx.
Strict mode with React 18 causing useEfffect to be called twice
and hence the AbortController is being called twice and causing
error in console.
*/
if (process.env.NODE_ENV === "test") {
root.render(
<StrictMode>
{renderApp()}
Expand Down

0 comments on commit 6ebb02d

Please sign in to comment.