The useEffect Hook is React’s main approach to handling Side Effects. Side Effects refer to anything that affects something outside the scope of the function being executed.
https://www.codeconcisely.com/posts/nextjs-multiple-layouts/
https://mortenbarklund.com/blog/react-architecture-provider-pattern/