@mocanvas/editor · function

useContainer

declare function useContainer(): HTMLElement

The editor's container element.

Throws outside a provider, because every use of it is a DOM operation that would otherwise silently target the wrong document. Reach for useContainerIfExists in a component that must also render on its own.

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.