useLayoutContext
function useLayoutContext(): LayoutContextType;Defined in: packages/react/src/hooks/layout/useLayoutContext.ts:20
Ensures that a layout context is provided via context. If no layout context is provided, an error is thrown.
Returns
Example
function LayoutAwareGrid() {
const layoutContext = useLayoutContext();
return <button onClick={() => layoutContext.setPin(null)}>Clear pin</button>;
}
<LayoutContextProvider><LayoutAwareGrid /></LayoutContextProvider>;