- Published on
useEffect changed in React 18 - useEffect called twice for an empty array
- Authors
- Name
- Lucas Floriani
- @lucasfloriani13
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
Its a way to force the developers to apply the unmount function inside the useEffect, preventing memory leaks inside our apps.