@mocanvas/editor · function
declare function useDelaySvgExport(): [isReady: boolean, resolve: () => void]Delay the export snapshot until this component says it is ready.
Returns true once the component has reported readiness — or immediately,
when there is no export in progress, so the same component renders normally
on the canvas without a branch. Call the returned resolve when the content
is actually on screen.
``tsx
const [isReady, resolve] = useDelaySvgExport()
return <Grid onReady={resolve} style={{ opacity: isReady ? 1 : 0 }} />
``
The counterpart of TLSvgExportContext.waitUntil for shapes rendered
through <foreignObject>, which have no other way to reach the context's
promise list.
Mentioned here
mocanvas is built by Symbio. Free for non-commercial, non-profit and development use; commercial use needs an agreement. Not affiliated with or endorsed by tldraw.