How to fix Warning: useLayoutEffect should not be used on the server because its effect cannot be encoded into the server renderer's output format. This will lead to a mismatch between the initial, non-hydrated UI and the intended UI. in React | DevErrors