Valora
API Reference@valora-ai/reactindexFunctions

useEnsureLayoutContext

function useEnsureLayoutContext(layoutContext?): LayoutContextType;

Defined in: packages/react/src/hooks/layout/useEnsureLayoutContext.ts:17

Ensures that a layout context is provided, either via context or explicitly as a parameter. If not inside a LayoutContext and no layout context is provided, an error is thrown.

Parameters

ParameterType
layoutContext?LayoutContextType

Returns

LayoutContextType

Example

const layoutContext = useEnsureLayoutContext();
return <button onClick={() => layoutContext.setPin(null)}>Clear pin</button>;

On this page

Valora is local-first

No API key, no server — everything in this doc runs on-device.

Star on GitHub