Published on

useEffect changed in React 18 - useEffect called twice for an empty array

Authors

useEffect changed in React 18 - useEffect called twice for an empty array

useEffect changed in React 18 - useEffect called twice for an empty array

In the version 18 of React the strict mode in development will change the steps a component is rendered:

PS: Its a preparation for the concurrentMode

Fallback text 1

Its a way to force the developers to apply the unmount function inside the useEffect, preventing memory leaks inside our apps.