Frequently asked questions for the tldraw SDK.
Not finding what you need?
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]
complete event and routes to the active tool state’s onComplete handler.EditingShape (Select tool child state): calls its onComplete, which exits the editing state, commits text/shape changes, and restores selection/focus to the canvas or the edited shape.// Example: end whatever the current tool is doing
editor.complete()
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.