Skip to content

[lexical-website] Documentation Update: use the real plugin component names in the editor-state React example - #9191

Merged
etrepum merged 1 commit into
meta:mainfrom
potatowagon:docs-editor-state-plugin-names
Sep 22, 2026
Merged

etrepum merged 1 commit into
meta:mainfrom
potatowagon:docs-editor-state-plugin-names

Conversation

@potatowagon

Copy link
Copy Markdown
Contributor

Description

The React example in the Editor State guide renders <LexicalRichTextPlugin />
and <LexicalOnChangePlugin />. Those are the module file names, not the
exported components — @lexical/react/LexicalRichTextPlugin exports
RichTextPlugin and @lexical/react/LexicalOnChangePlugin exports
OnChangePlugin — so the snippet renders nothing that exists.

This uses the exported names, and fills in RichTextPlugin's required
contentEditable and ErrorBoundary props (it had neither), matching how the
same component is written in getting-started/react.md.

Test plan

Documentation-only change (markdown is excluded from prettier via
.prettierignore), so the check is that the JSX names components that are
exported.

Before

$ grep -n "LexicalRichTextPlugin\|LexicalOnChangePlugin" packages/lexical-website/docs/concepts/editor-state.md
98:  <LexicalRichTextPlugin />
99:  <LexicalOnChangePlugin onChange={(editorState) => {

$ grep -n "export function RichTextPlugin\|export function OnChangePlugin" packages/lexical-react/src/LexicalRichTextPlugin.tsx packages/lexical-react/src/LexicalOnChangePlugin.ts
packages/lexical-react/src/LexicalRichTextPlugin.tsx:31:export function RichTextPlugin({
packages/lexical-react/src/LexicalOnChangePlugin.ts:22:export function OnChangePlugin({

Neither LexicalRichTextPlugin nor LexicalOnChangePlugin is an exported
component, and RichTextPlugin's ErrorBoundary prop is required
(LexicalRichTextPlugin.tsx:42).

After

$ sed -n '96,103p' packages/lexical-website/docs/concepts/editor-state.md
  <RichTextPlugin
    contentEditable={<ContentEditable />}
    ErrorBoundary={LexicalErrorBoundary}
  />
  <OnChangePlugin onChange={(editorState) => {
    editorStateRef.current = editorState;
  }} />

Matches the working example in
packages/lexical-website/docs/getting-started/react.md:63-71.

… names in the editor-state React example

## Description

The React example in the Editor State guide renders `<LexicalRichTextPlugin />`
and `<LexicalOnChangePlugin />`. Those are the module file names, not the
exported components — `@lexical/react/LexicalRichTextPlugin` exports
`RichTextPlugin` and `@lexical/react/LexicalOnChangePlugin` exports
`OnChangePlugin` — so the snippet renders nothing that exists.

This uses the exported names, and fills in `RichTextPlugin`'s required
`contentEditable` and `ErrorBoundary` props (it had neither), matching how the
same component is written in `getting-started/react.md`.

## Test plan

Documentation-only change (markdown is excluded from prettier via
`.prettierignore`), so the check is that the JSX names components that are
exported.

### Before

```
$ grep -n "LexicalRichTextPlugin\|LexicalOnChangePlugin" packages/lexical-website/docs/concepts/editor-state.md
98:  <LexicalRichTextPlugin />
99:  <LexicalOnChangePlugin onChange={(editorState) => {

$ grep -n "export function RichTextPlugin\|export function OnChangePlugin" packages/lexical-react/src/LexicalRichTextPlugin.tsx packages/lexical-react/src/LexicalOnChangePlugin.ts
packages/lexical-react/src/LexicalRichTextPlugin.tsx:31:export function RichTextPlugin({
packages/lexical-react/src/LexicalOnChangePlugin.ts:22:export function OnChangePlugin({
```

Neither `LexicalRichTextPlugin` nor `LexicalOnChangePlugin` is an exported
component, and `RichTextPlugin`'s `ErrorBoundary` prop is required
(`LexicalRichTextPlugin.tsx:42`).

### After

```
$ sed -n '96,103p' packages/lexical-website/docs/concepts/editor-state.md
  <RichTextPlugin
    contentEditable={<ContentEditable />}
    ErrorBoundary={LexicalErrorBoundary}
  />
  <OnChangePlugin onChange={(editorState) => {
    editorStateRef.current = editorState;
  }} />
```

Matches the working example in
`packages/lexical-website/docs/getting-started/react.md:63-71`.
@vercel

vercel Bot commented Sep 22, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
lexical Ready Ready Preview Sep 22, 2026 11:36am UTC
lexical-playground Ready Ready Preview Sep 22, 2026 11:36am UTC

Request Review

@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Sep 22, 2026
@etrepum
etrepum added this pull request to the merge queue Sep 22, 2026
Merged via the queue into meta:main with commit 1a255d1 Sep 22, 2026
42 checks passed
@etrepum etrepum mentioned this pull request Sep 28, 2026

This branch was successfully deployed

2 active deployments
Preview – lexical — f7ddd72b Deployed Sep 22, 2026 by vercel[bot]
Preview – lexical-playground — f7ddd72b Deployed Sep 22, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants