The useEffect is mainly used for things which React is not aware of. In other words, for things which are outside the control of React library. API calls, event handlers, etc are executed inside this hook. useEffect will run after the DOM content has been rendered.