Repository navigation
[lexical-website] Documentation Update: use the real plugin component names in the editor-state React example - #9191
Merged
Conversation
… 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`.
potatowagon
requested review from
acywatson,
etrepum,
fantactuka,
ivailop7 and
zurfyx
as code owners
September 22, 2026 11:35
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
etrepum
approved these changes
Sep 22, 2026
Merged
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
The React example in the Editor State guide renders
<LexicalRichTextPlugin />and
<LexicalOnChangePlugin />. Those are the module file names, not theexported components —
@lexical/react/LexicalRichTextPluginexportsRichTextPluginand@lexical/react/LexicalOnChangePluginexportsOnChangePlugin— so the snippet renders nothing that exists.This uses the exported names, and fills in
RichTextPlugin's requiredcontentEditableandErrorBoundaryprops (it had neither), matching how thesame 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 areexported.
Before
Neither
LexicalRichTextPluginnorLexicalOnChangePluginis an exportedcomponent, and
RichTextPlugin'sErrorBoundaryprop is required(
LexicalRichTextPlugin.tsx:42).After
Matches the working example in
packages/lexical-website/docs/getting-started/react.md:63-71.