ui/client/features/pages-editor/hooks/usePreviewMeasure
Cockpit client (features), v0.8. Source: ui/client/features/pages-editor/hooks/usePreviewMeasure.tsx.
Functions#
usePreviewMeasure()#
usePreviewMeasure():
object
Defined in: ui/client/features/pages-editor/hooks/usePreviewMeasure.tsx:9
Measures the box the preview iframe fills, live. A callback ref, because the box is mounted and unmounted as the preview connects, disconnects and goes full screen — each time we re-observe whatever is now there. This is what makes the size readout honest: "1280" in a 900px stage reads 900.
Returns#
object
boxRef
boxRef: (
node) =>void
Parameters
node
HTMLDivElement | null
Returns
void
measured
measured: {
height:number;width:number; } |null