Functions & Hooks

useOffscreenSvg

function useOffscreenSvg(
   element: ReactNode, 
   options: RenderToSvgOptions, 
   deps?: unknown[]): string | null;

Render a scene to SVG markup and get the text back when it is ready.

The declarative half of renderToSvg: null on the first frame, then the document. Pass deps - the values the scene depends on - or memoise the tree, or every parent render re-exports.

Parameters

element

ReactNode

options

RenderToSvgOptions

deps?

unknown[]

Returns

string | null

On this page