useEffect

To some extent, 'useEffect' is to life-cycle methods as what 'useState' is to state.Mutations, network requests, subscriptions, timers, logging, and other side effects are not allowed inside the main body of a functional component (referred to as React's render phase). Doing so will lead to confusing bugs and inconsistencies in the UI.Instead, use 'useEffect()', which accepts a function that is executed after every render.