@mocanvas/editor · function

EditorProvider

declare function EditorProvider({ editor, children }: EditorProviderProps): react.JSX.Element

Publishes an editor to the React tree.

Takes the editor as editor rather than a context provider's value, so a test — or an app rendering chrome outside <Canvas> — writes <EditorProvider editor={editor}> and never has to know that a context is what is underneath. EditorContext is still exported for the rare caller that wants the raw provider (to publish null, say).

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.