useTldrawI18n

See source code

Builds the TLI18nAdapter the editor hands to code that has no access to React context, such as a ShapeUtil. <Tldraw /> wires this up for you; call it yourself only when composing <TldrawEditor /> by hand, and from inside a <TldrawUiTranslationProvider />.

function useTldrawI18n(): TLI18nAdapter;

Example

function MyEditor(props: TldrawEditorProps) {
  const i18n = useTldrawI18n();
  return <TldrawEditor {...props} i18n={i18n} />;
}
Prev
useStylePanelContext
Next
useTldrawUiComponents