You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
useIsomorphicLayoutEffect hook is not being called in SSR mode (using React 18.x). navigation seems not to be working too.
Workaround:
exportconstRedirect=({ to }: RedirectProps)=>{const[,navigate]=useLocation();constrouter=useRouter();if(isSSR()){(router.hookasany).history.push(concatUrls(router.base,to));}useAfterMount(()=>{navigate(to);});returnnull;};
The text was updated successfully, but these errors were encountered:
Mati365
changed the title
Redirect not work in SSR mode in 2.9 version
Redirect not work in SSR mode in 2.9 version using React 18
Mar 2, 2023
This code:
is not triggering redirect in SSR (on client side it is working correctly). Probably because used for example here:
wouter/index.js
Line 188 in efda2ab
useIsomorphicLayoutEffect
hook is not being called in SSR mode (using React 18.x).navigation
seems not to be working too.Workaround:
The text was updated successfully, but these errors were encountered: