diff --git a/packages/libs/kode-ui/src/patterns/SideBarLayout/SideBarLayout.tsx b/packages/libs/kode-ui/src/patterns/SideBarLayout/SideBarLayout.tsx index b2778005a1..5ec71a9e0d 100644 --- a/packages/libs/kode-ui/src/patterns/SideBarLayout/SideBarLayout.tsx +++ b/packages/libs/kode-ui/src/patterns/SideBarLayout/SideBarLayout.tsx @@ -44,7 +44,7 @@ export const SideBarLayout: FC = ({ //and then saved in the layout useEffect(() => { setLocation(location); - }, [location.url]); + }, [location?.url, location?.hash]); return ( diff --git a/packages/libs/kode-ui/src/patterns/SideBarLayout/components/SideBarAside.tsx b/packages/libs/kode-ui/src/patterns/SideBarLayout/components/SideBarAside.tsx index 7848379681..5bc8361b56 100644 --- a/packages/libs/kode-ui/src/patterns/SideBarLayout/components/SideBarAside.tsx +++ b/packages/libs/kode-ui/src/patterns/SideBarLayout/components/SideBarAside.tsx @@ -28,8 +28,8 @@ export const SideBarAside: FC< }; useEffect(() => { - handleSetAsideExpanded(!!location.hash); - }, [location.hash]); + handleSetAsideExpanded(!!location?.hash); + }, [location?.hash]); return ( <>