Skip to content

useSidebarOptional

useSidebarOptional(): SidebarContextProps | null

Defined in: packages/react/src/ui/sidebar.tsx:89

Same context useSidebar reads, but null outside a SidebarProvider instead of throwing — for a caller that works WITH or WITHOUT one (ListViewPeek.tsx’s own sidebar-aware positioning: every REAL admin page renders inside AdminLayout’s SidebarProvider, but the test harness (testing/harness/viewHarness.tsx) doesn’t wrap one, and “no sidebar, no offset” — today’s exact behavior — is the correct fallback there, not a thrown error).

SidebarContextProps | null