We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
host
1 parent fb44846 commit d2df3a1Copy full SHA for d2df3a1
components/main-nav.tsx
@@ -17,8 +17,13 @@ interface MainNavProps {
17
export function MainNav({ items }: MainNavProps) {
18
const segment = useSelectedLayoutSegment();
19
const [showMobileMenu, setShowMobileMenu] = React.useState<boolean>(false);
20
+ const [host, setHost] = React.useState("");
21
- const host = window && window.location.origin;
22
+ React.useEffect(() => {
23
+ if (typeof window !== "undefined") {
24
+ setHost(window.location.origin as string);
25
+ }
26
+ }, []);
27
28
return (
29
<header>
0 commit comments