useViewportContext
useViewportContext():
ViewportContextValue
Defined in: src/components/primitives/viewport/ViewportContext.ts:43
Read viewport state from inside <Viewport> children.
Returns transform, size, isPanning, and the imperative handle.
The hook subscribes to every store mutation — if you only need one slice
(e.g. just the transform) reach for useViewportStore() directly and
subscribe to a single slice with useSyncExternalStore.
Returns
Throws
If called outside a <Viewport> subtree.
Example
function Minimap() { const { transform, size, handle } = useViewportContext(); // ...}