Frequently asked questions for the tldraw SDK.

Not finding what you need?


What does editor.complete() do?

Short answer: it ends the current tool interaction by invoking the tool state machine’s onComplete callback. In EditingShape, it finalizes the edit and returns focus to the canvas or shape.[1][2][3][4]

Details

// Example: end whatever the current tool is doing
editor.complete()

Can I use useEditor outside of the Tldraw React tree?

Short answer: not directly. useEditor relies on the Tldraw React context. If you need to access the editor from other parts of your app, hoist the editor instance on mount and share it yourself.