Error msg : Error: Hydration failed because the initial UI does not match what was rendered on the server
'use client'
export default function Navbar({ isLoggedIn }) {
return isLoggedIn ? null :
typeof window !== 'undefined' ? null :
<div>
<a
href={`${
window.origin + process.env.NEXT_PUBLIC_BASE_PATH
}/auth/login?return_to=${window.location}`}
className="sign-in-button"
>
Sign in
</a>
</div>
}
So how do I fix this hydration issue?