diff --git a/packages/core/src/layout/Sidebar/Page.tsx b/packages/core/src/layout/Sidebar/Page.tsx index 2a4cf0fbb2..0c6f4a526d 100644 --- a/packages/core/src/layout/Sidebar/Page.tsx +++ b/packages/core/src/layout/Sidebar/Page.tsx @@ -45,7 +45,9 @@ export const SidebarPinStateContext = createContext( ); export const SidebarPage: FC<{}> = props => { - const [isPinned, setIsPinned] = useState(LocalStorage.getSidebarPinState()); + const [isPinned, setIsPinned] = useState(() => + LocalStorage.getSidebarPinState(), + ); useEffect(() => { LocalStorage.setSidebarPinState(isPinned);