Skip to content

Conversation

@everettbu
Copy link

@everettbu everettbu commented Dec 13, 2025

Mirror of facebook/react#35331
Original author: poteto


Add suppression for React$Element incompatibility with ReactNodeList in
ReactDOMRootFB.js render function. Flow 0.282 has stricter type checking
for the React$Node union type.


Stack created with Sapling. Best reviewed with ReviewStack.

  • #35334
  • #35333
  • #35332
  • -> #35331
  • #35330
  • #35329

Flow 0.280 introduced stricter type checking for `incompatible-type` errors,
requiring additional $FlowFixMe suppressions alongside existing ones. Changes:

- Made `QueuingStrategy` properties optional in streams.js
- Made all properties optional in Web Animations API types (EffectTiming,
  KeyframeAnimationOptions, etc.)
- Added `$FlowFixMe[incompatible-type]` alongside existing suppressions in
  multiple files where Flow now reports additional type mismatches
Major changes in Flow 0.281:
- $FlowFixMe comments now require explicit error codes (e.g., $FlowFixMe[incompatible-type])
- Changed all bare $FlowFixMe to include appropriate error codes
- Changed $FlowIgnore to $FlowFixMe where needed
- Fixed stream types to have cancel() return Promise<void> instead of void
- Added pseudoElement property to KeyframeEffect type
- Added suppressions for Proxy handler variance issues
- Fixed various type errors across the codebase
Add suppression for React\$Element incompatibility with ReactNodeList in
  ReactDOMRootFB.js render function. Flow 0.282 has stricter type checking
  for the React\$Node union type.
@everettbu everettbu added CLA Signed React Core Team Opened by a member of the React Core Team labels Dec 13, 2025
@greptile-apps
Copy link

greptile-apps bot commented Dec 13, 2025

Greptile Overview

Greptile Summary

Upgrades Flow type checker from version 0.281 to 0.282, addressing stricter type checking requirements introduced in the new version.

Key Changes:

  • Updated Flow version in package.json and flow-remove-types dependency
  • Updated flow-typed environment definitions for streams and web-animations APIs to match Flow 0.282 expectations (made properties optional, updated return types)
  • Added $FlowFixMe[incompatible-type] suppressions throughout the codebase where Flow 0.282's stricter checking flagged React$Element incompatibility with ReactNodeList
  • Replaced generic $FlowIgnore comments with more specific $FlowFixMe[error-code] annotations for better documentation

The changes are purely mechanical, maintaining existing runtime behavior while satisfying the stricter static type checks. All suppressions appear to be justified by existing type system limitations rather than actual runtime issues.

Confidence Score: 5/5

  • Safe to merge with no risk - routine Flow version upgrade with appropriate type suppressions
  • This is a standard dependency upgrade with well-understood changes. All modifications are type-level only (no runtime behavior changes), suppressions are properly documented, and the changes follow established patterns from previous Flow upgrades in this codebase
  • No files require special attention

Important Files Changed

File Analysis

Filename Score Overview
package.json 5/5 Flow version bumped from 0.279 to 0.282 along with flow-remove-types
flow-typed/environments/streams.js 5/5 Updated stream types to match Flow 0.282: cancel() returns Promise, reason accepts mixed, and QueuingStrategy properties made optional
flow-typed/environments/web-animations.js 5/5 Made animation properties optional to match Flow 0.282 type definitions, added missing pseudoElement property to KeyframeEffect
packages/react-dom/src/client/ReactDOMRootFB.js 5/5 Added FlowFixMe suppressions for React$Element incompatibility with ReactNodeList due to stricter type checking in Flow 0.282
packages/react-reconciler/src/ReactFiberWorkLoop.js 5/5 Added incompatible-type suppressions for performUnitOfWork calls in concurrent work loops
packages/react-client/src/ReactFlightClient.js 5/5 Updated FlowFixMe comments to use specific error codes (prop-missing, incompatible-type, incompatible-use) instead of generic suppressions

Copy link

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

59 files reviewed, no comments

Edit Code Review Agent Settings | Greptile

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed React Core Team Opened by a member of the React Core Team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants