MobileSidebarProvider() — supabase Function Reference
Architecture documentation for the MobileSidebarProvider() function in mobile-sidebar-context.tsx from the supabase codebase.
Entity Profile
Relationship Graph
Source Code
apps/design-system/context/mobile-sidebar-context.tsx lines 15–35
export function MobileSidebarProvider({ children }: MobileSidebarProviderProps) {
const [open, setOpen] = useState(false)
// Use useCallback for stable function references
const handleSetOpen = useCallback((value: boolean) => {
setOpen(value)
}, [])
const toggle = useCallback(() => {
setOpen((prev) => !prev)
}, [])
// Memoize the context value to prevent unnecessary re-renders
const value: MobileSidebarContextType = {
open,
setOpen: handleSetOpen,
toggle,
}
return <MobileSidebarContext.Provider value={value}>{children}</MobileSidebarContext.Provider>
}
Domain
Subdomains
Source
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free