Skip to content

[lexical-website] Documentation Update: useReactDecorators, and the three missing TextNode formats - #9201

Merged
etrepum merged 1 commit into
meta:mainfrom
potatowagon:docs-nodes-decorators-formats
Sep 23, 2026
Merged

etrepum merged 1 commit into
meta:mainfrom
potatowagon:docs-nodes-decorators-formats

Conversation

@potatowagon

Copy link
Copy Markdown
Contributor

Description

Two small drifts in concepts/nodes.mdx:

  1. Two paragraphs describe decorator rendering as "Using useDecorators,
    PlainTextPlugin and RichTextPlugin ...". There is no useDecorators in
    @lexical/react; the hook is useReactDecorators.
  2. The TextNode section lists eight text formats. TEXT_TYPE_TO_FORMAT has
    eleven — capitalize, lowercase and uppercase are missing from the doc.

Test plan

Documentation-only change (markdown is excluded from prettier via
.prettierignore), so the check is that the names and the list match source.

Before

$ grep -n "useDecorators" packages/lexical-website/docs/concepts/nodes.mdx
780:Using `useDecorators`, `PlainTextPlugin` and `RichTextPlugin` executes `React.createPortal(reactDecorator, element)` for each `DecoratorNode`,
1016:Using `useDecorators`, `PlainTextPlugin` and `RichTextPlugin` executes `React.createPortal(reactDecorator, element)` for each `DecoratorNode`,

$ grep -rn "useDecorators" packages/lexical-react/src | wc -l
0

$ sed -n '65p' packages/lexical-website/docs/concepts/nodes.mdx
- `format` any combination of `bold`, `italic`, `underline`, `strikethrough`, `code`, `highlight`, `subscript` and `superscript`

After

$ grep -n "useReactDecorators" packages/lexical-website/docs/concepts/nodes.mdx
780:Using `useReactDecorators`, `PlainTextPlugin` and `RichTextPlugin` executes [...]
1016:Using `useReactDecorators`, `PlainTextPlugin` and `RichTextPlugin` executes [...]

$ grep -n "export function useReactDecorators" packages/lexical-react/src/shared/useReactDecorators.tsx
18:export function useReactDecorators(

$ sed -n '65p' packages/lexical-website/docs/concepts/nodes.mdx
- `format` any combination of `bold`, `italic`, `underline`, `strikethrough`, `code`, `highlight`, `subscript`, `superscript`, `lowercase`, `uppercase` and `capitalize`

$ sed -n '/TEXT_TYPE_TO_FORMAT/,/^};/p' packages/lexical/src/LexicalConstants.ts
export const TEXT_TYPE_TO_FORMAT: Record<TextFormatType | string, number> = {
  bold: IS_BOLD,
  capitalize: IS_CAPITALIZE,
  code: IS_CODE,
  highlight: IS_HIGHLIGHT,
  italic: IS_ITALIC,
  lowercase: IS_LOWERCASE,
  strikethrough: IS_STRIKETHROUGH,
  subscript: IS_SUBSCRIPT,
  superscript: IS_SUPERSCRIPT,
  underline: IS_UNDERLINE,
  uppercase: IS_UPPERCASE,
};

The documented list is now the eleven formats in LexicalConstants.ts:136-148.

…hree missing TextNode formats

## Description

Two small drifts in `concepts/nodes.mdx`:

1. Two paragraphs describe decorator rendering as "Using `useDecorators`,
   `PlainTextPlugin` and `RichTextPlugin` ...". There is no `useDecorators` in
   `@lexical/react`; the hook is `useReactDecorators`.
2. The `TextNode` section lists eight text formats. `TEXT_TYPE_TO_FORMAT` has
   eleven — `capitalize`, `lowercase` and `uppercase` are missing from the doc.

## Test plan

Documentation-only change (markdown is excluded from prettier via
`.prettierignore`), so the check is that the names and the list match source.

### Before

```
$ grep -n "useDecorators" packages/lexical-website/docs/concepts/nodes.mdx
780:Using `useDecorators`, `PlainTextPlugin` and `RichTextPlugin` executes `React.createPortal(reactDecorator, element)` for each `DecoratorNode`,
1016:Using `useDecorators`, `PlainTextPlugin` and `RichTextPlugin` executes `React.createPortal(reactDecorator, element)` for each `DecoratorNode`,

$ grep -rn "useDecorators" packages/lexical-react/src | wc -l
0

$ sed -n '65p' packages/lexical-website/docs/concepts/nodes.mdx
- `format` any combination of `bold`, `italic`, `underline`, `strikethrough`, `code`, `highlight`, `subscript` and `superscript`
```

### After

```
$ grep -n "useReactDecorators" packages/lexical-website/docs/concepts/nodes.mdx
780:Using `useReactDecorators`, `PlainTextPlugin` and `RichTextPlugin` executes [...]
1016:Using `useReactDecorators`, `PlainTextPlugin` and `RichTextPlugin` executes [...]

$ grep -n "export function useReactDecorators" packages/lexical-react/src/shared/useReactDecorators.tsx
18:export function useReactDecorators(

$ sed -n '65p' packages/lexical-website/docs/concepts/nodes.mdx
- `format` any combination of `bold`, `italic`, `underline`, `strikethrough`, `code`, `highlight`, `subscript`, `superscript`, `lowercase`, `uppercase` and `capitalize`

$ sed -n '/TEXT_TYPE_TO_FORMAT/,/^};/p' packages/lexical/src/LexicalConstants.ts
export const TEXT_TYPE_TO_FORMAT: Record<TextFormatType | string, number> = {
  bold: IS_BOLD,
  capitalize: IS_CAPITALIZE,
  code: IS_CODE,
  highlight: IS_HIGHLIGHT,
  italic: IS_ITALIC,
  lowercase: IS_LOWERCASE,
  strikethrough: IS_STRIKETHROUGH,
  subscript: IS_SUBSCRIPT,
  superscript: IS_SUPERSCRIPT,
  underline: IS_UNDERLINE,
  uppercase: IS_UPPERCASE,
};
```

The documented list is now the eleven formats in `LexicalConstants.ts:136-148`.
@vercel

vercel Bot commented Sep 23, 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 23, 2026 6:33am UTC
lexical-playground Ready Ready Preview Sep 23, 2026 6:33am 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 23, 2026
@etrepum
etrepum added this pull request to the merge queue Sep 23, 2026
Merged via the queue into meta:main with commit 3477f88 Sep 23, 2026
42 checks passed
@etrepum etrepum mentioned this pull request Sep 28, 2026

This branch was successfully deployed

2 active deployments
Preview – lexical — d0fc620a Deployed Sep 23, 2026 by vercel[bot]
Preview – lexical-playground — d0fc620a Deployed Sep 23, 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