Typix LogoTypix
CoreProviders

TypixEditorProvider

Context provider that makes the TypixEditor instance available

TypixEditorProvider creates a TypixEditor instance from the Lexical editor and provides it via React context. This is set up automatically by EditorRoot.

Import

import { TypixEditorProvider } from '@typix-editor/react';

Usage

You typically don't need to use this directly. EditorRoot includes it automatically.

If you're building a custom editor root without EditorRoot, wrap your components in TypixEditorProvider inside a LexicalComposer:

import { LexicalComposer } from '@lexical/react/LexicalComposer';
import { TypixEditorProvider } from '@typix-editor/react';

function CustomEditorRoot({ children, config }) {
  return (
    <LexicalComposer initialConfig={config}>
      <TypixEditorProvider>
        {children}
      </TypixEditorProvider>
    </LexicalComposer>
  );
}

Props

PropTypeDescription
childrenReactNodeComponents that need access to the TypixEditor

Context value

PropertyTypeDescription
editorTypixEditorThe TypixEditor instance

On this page