useLayoutEffect works exactly the same as useEffect
useLayoutEffect runs synchronously while useEffect runs asynchronously
useLayoutEffect runs after the code mutation
useLayoutEffect make changes before the browser paints the DOM
Just remember useLayoutEffect is identical to useEffect but runs synchronously !!