Skip to content

[lexical-react] Chore: make ref types mutable#7633

Merged
etrepum merged 1 commit intofacebook:mainfrom
findoo:mutable-refs
Jun 21, 2025
Merged

[lexical-react] Chore: make ref types mutable#7633
etrepum merged 1 commit intofacebook:mainfrom
findoo:mutable-refs

Conversation

@findoo
Copy link
Copy Markdown
Contributor

@findoo findoo commented Jun 19, 2025

Description

Fixes a typescript error when using Lexical with React 19 - as refs are all now mutable.

const menuRef = useRef<HTMLDivElement>(null);

...

<DraggableBlockPlugin_EXPERIMENTAL
        menuRef={menuRef}
Type 'RefObject<HTMLDivElement | null>' is not assignable to type 'RefObject<HTMLElement>'.
  Type 'HTMLDivElement | null' is not assignable to type 'HTMLElement'.
    Type 'null' is not assignable to type 'HTMLElement'.ts(2322)

This matches the flow types.

Test plan

Before

Insert relevant screenshots/recordings/automated-tests

After

Insert relevant screenshots/recordings/automated-tests

@facebook-github-bot
Copy link
Copy Markdown
Contributor

Hi @findoo!

Thank you for your pull request and welcome to our community.

Action Required

In order to merge any pull request (code, docs, etc.), we require contributors to sign our Contributor License Agreement, and we don't seem to have one on file for you.

Process

In order for us to review and merge your suggested changes, please sign at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need to sign the corporate CLA.

Once the CLA is signed, our tooling will perform checks and validations. Afterwards, the pull request will be tagged with CLA signed. The tagging process may take up to 1 hour after signing. Please give it that time before contacting us about it.

If you have received this in error or have any questions, please contact us at cla@meta.com. Thanks!

@vercel
Copy link
Copy Markdown

vercel bot commented Jun 19, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
lexical ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jun 19, 2025 2:26pm
lexical-playground ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jun 19, 2025 2:26pm

@facebook-github-bot
Copy link
Copy Markdown
Contributor

Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Meta Open Source project. Thanks!

@facebook-github-bot facebook-github-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 Jun 19, 2025
@findoo findoo marked this pull request as ready for review June 19, 2025 17:05
@etrepum etrepum added this pull request to the merge queue Jun 21, 2025
Merged via the queue into facebook:main with commit a69091b Jun 21, 2025
68 of 69 checks passed
@etrepum etrepum mentioned this pull request Jul 3, 2025
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.

3 participants