Skip to content

Commit d2df3a1

Browse files
committed
refactor: host state value for resume link
1 parent fb44846 commit d2df3a1

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

components/main-nav.tsx

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,13 @@ interface MainNavProps {
1717
export function MainNav({ items }: MainNavProps) {
1818
const segment = useSelectedLayoutSegment();
1919
const [showMobileMenu, setShowMobileMenu] = React.useState<boolean>(false);
20+
const [host, setHost] = React.useState("");
2021

21-
const host = window && window.location.origin;
22+
React.useEffect(() => {
23+
if (typeof window !== "undefined") {
24+
setHost(window.location.origin as string);
25+
}
26+
}, []);
2227

2328
return (
2429
<header>

0 commit comments

Comments
 (0)