Skip to content

Interface: DurableCanvas

Defined in: adopt.ts:98

A canvas that outlives the components that show it.

Properties

canvas

canvas: HTMLCanvasElement

Defined in: adopt.ts:100

Created once per page, re-parented by whichever component is current.

Methods

adopt()

adopt(setup?): Adoption

Defined in: adopt.ts:106

Adopt the canvas into a host element. Call in the component body: ref={field.adopt()}. The optional setup wires anything that belongs to this component (pointer listeners, say) and returns their teardown.

Parameters

setup?

(canvas) => Release

Returns

Adoption