Repository navigation
[lexical-website] Documentation Update: fix five incorrect snippets and claims in the React plugins guide - #9254
Merged
Conversation
…nd claims in the React plugins guide
## Description
Five corrections in `react/plugins.md`, all against the components it
documents:
1. **The intro `PlainTextPlugin` snippet omits the required `ErrorBoundary`
prop** and passes `placeholder` to the plugin. `ErrorBoundary` is
non-optional, and `placeholder` on the plugin is marked "TODO Remove. This
property is now part of ContentEditable". Every other `PlainTextPlugin`
snippet on the page already does it the right way; this brings the first
one into line and imports `LexicalErrorBoundary`.
2. **The `CollaborationPlugin` example renders the plugin bare.**
`useCollaborationContext` asserts the context is present, and
`devInvariant` throws outside production, so the snippet as written throws
in development. The plugin's own jsdoc says "Must be used within a
`LexicalCollaboration` provider".
3. **`headingTag` is documented as "either 'h1', 'h2', or 'h3'".**
`HeadingTagType` is `'h1'`–`'h6'`, and `TableOfContentsPlugin` collects
every `$isHeadingNode` child with no tag filter.
4. **The `LexicalAutoLinkPlugin` section has no registration note**, unlike
the Link, HorizontalRule, Hashtag, AutoEmbed and CharacterLimit sections.
The plugin hard-fails with an invariant when `AutoLinkNode` is missing.
5. **`EmbedConfig` is imported as a value.** It is a type-only export, so the
runtime import has no such binding.
## Test plan
Documentation-only change (markdown is excluded from prettier via
`.prettierignore`), so the checks are the props' types and the exports.
### Before
```
$ sed -n '33,36p' packages/lexical-website/docs/react/plugins.md
<PlainTextPlugin
contentEditable={<ContentEditable />}
placeholder={<div>Enter some text...</div>}
/>
$ grep -n "ErrorBoundary: ErrorBoundaryType\|TODO Remove" packages/lexical-react/src/LexicalPlainTextPlugin.tsx
33: * TODO Remove. This property is now part of ContentEditable
42: ErrorBoundary: ErrorBoundaryType;
$ grep -n "LexicalCollaboration" packages/lexical-website/docs/react/plugins.md
$ sed -n '98,101p' packages/lexical-react/src/LexicalCollaborationContextUtils.ts
devInvariant(
collabContext != null,
'useCollaborationContext: no context provider found',
);
$ grep -n "headingTag\`: A string" packages/lexical-website/docs/react/plugins.md
427:`headingTag`: A string that reads either 'h1', 'h2', or 'h3'.
$ grep -n "export type HeadingTagType" packages/lexical-rich-text/src/index.ts
338:export type HeadingTagType = 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6';
$ awk 'NR>=313 && NR<=350 && /Requires/' packages/lexical-website/docs/react/plugins.md
$ grep -n -A3 "invariant(" packages/lexical-react/src/LexicalAutoLinkPlugin.ts
35: invariant(
36- false,
37- 'LexicalAutoLinkPlugin: AutoLinkNode not registered on editor',
$ grep -n "EmbedConfig, AutoEmbedOption" packages/lexical-website/docs/react/plugins.md
356:import {LexicalAutoEmbedPlugin, EmbedConfig, AutoEmbedOption} from '@lexical/react/LexicalAutoEmbedPlugin';
$ grep -n "type EmbedConfig" packages/lexical-react/src/LexicalAutoEmbedPlugin.tsx
41: type EmbedConfig,
```
### After
```
$ sed -n '34,39p' packages/lexical-website/docs/react/plugins.md
<PlainTextPlugin
contentEditable={
<ContentEditable placeholder={<div>Enter some text...</div>} />
}
ErrorBoundary={LexicalErrorBoundary}
/>
$ grep -n "LexicalCollaboration>" packages/lexical-website/docs/react/plugins.md
471:<LexicalCollaboration>
481:</LexicalCollaboration>
$ grep -n "headingTag\`:" packages/lexical-website/docs/react/plugins.md
433:`headingTag`: The heading's tag — `'h1'` through `'h6'`. Every heading in the document is listed; the plugin does not filter by level.
$ awk 'NR>=313 && NR<=325 && /Requires/' packages/lexical-website/docs/react/plugins.md
> Note: Requires `AutoLinkNode` from `@lexical/link` to be registered.
$ sed -n '361,362p' packages/lexical-website/docs/react/plugins.md
import {LexicalAutoEmbedPlugin, AutoEmbedOption} from '@lexical/react/LexicalAutoEmbedPlugin';
import type {EmbedConfig} from '@lexical/react/LexicalAutoEmbedPlugin';
```
`LexicalCollaboration` is exported from
`@lexical/react/LexicalCollaborationContext`
(`packages/lexical-react/src/LexicalCollaborationContext.tsx:29`), which is a
published subpath. The registration note is worded to match the five sibling
sections that already carry one.
potatowagon
requested review from
acywatson,
etrepum,
fantactuka,
ivailop7 and
zurfyx
as code owners
September 28, 2026 07:58
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
etrepum
approved these changes
Sep 28, 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
Five corrections in
react/plugins.md, all against the components itdocuments:
PlainTextPluginsnippet omits the requiredErrorBoundaryprop and passes
placeholderto the plugin.ErrorBoundaryisnon-optional, and
placeholderon the plugin is marked "TODO Remove. Thisproperty is now part of ContentEditable". Every other
PlainTextPluginsnippet on the page already does it the right way; this brings the first
one into line and imports
LexicalErrorBoundary.CollaborationPluginexample renders the plugin bare.useCollaborationContextasserts the context is present, anddevInvariantthrows outside production, so the snippet as written throwsin development. The plugin's own jsdoc says "Must be used within a
LexicalCollaborationprovider".headingTagis documented as "either 'h1', 'h2', or 'h3'".HeadingTagTypeis'h1'–'h6', andTableOfContentsPlugincollectsevery
$isHeadingNodechild with no tag filter.LexicalAutoLinkPluginsection has no registration note, unlikethe Link, HorizontalRule, Hashtag, AutoEmbed and CharacterLimit sections.
The plugin hard-fails with an invariant when
AutoLinkNodeis missing.EmbedConfigis imported as a value. It is a type-only export, so theruntime import has no such binding.
Test plan
Documentation-only change (markdown is excluded from prettier via
.prettierignore), so the checks are the props' types and the exports.Before
After
LexicalCollaborationis exported from@lexical/react/LexicalCollaborationContext(
packages/lexical-react/src/LexicalCollaborationContext.tsx:29), which is apublished subpath. The registration note is worded to match the five sibling
sections that already carry one.