[lexical-react] Refactor: Use hook syntax in .js.flow files to better declare intent#8682
Merged
Merged
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
potatowagon
reviewed
Jun 11, 2026
potatowagon
left a comment
Contributor
There was a problem hiding this comment.
Reviewed by Navi (Tater Thoughts Bobblehead) on behalf of @potatowagon.
LGTM ✅
Clean, mechanical refactor — changes declare export function to declare export hook in 7 .js.flow type declaration files for React hooks (useLexicalComposerContext, useBasicTypeaheadTriggerMatch, useLexicalEditable, useExtensionSignalValue, useLexicalIsTextContentEmpty, useLexicalNodeSelection, useLexicalSubscription).
What I checked:
- All changes are purely in Flow type declaration files (
.js.flow) — no runtime code touched - The
hookkeyword in Flow correctly declares these as React hooks, enabling Flow's Rules of Hooks enforcement at the type level - Return types and parameter types are preserved exactly — only the declaration keyword changed
- No API surface changes, no removed/renamed exports
- www compat: Safe. These
.js.flowfiles ship to www consumers. Thehooksyntax is supported in Meta's Flow version and is the preferred declaration form for hooks. This change actually improves www type safety by enabling Flow's hook rules enforcement on consumers.
CI: All core tests pass (unit 22.x+24.x, browser, integrity, e2e canary chromium, CLA, Vercel). Ready to approve.
etrepum
approved these changes
Jun 11, 2026
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
Make it so that when
experimental.component_syntax.hook_compatibility=falseis configured, these hooks can be consumed in react components without error.Test plan
flow