Skip to content

fix flow typing of mockComponent#53739

Closed
panagosg7 wants to merge 1 commit into
facebook:mainfrom
panagosg7:export-D82226987
Closed

fix flow typing of mockComponent#53739
panagosg7 wants to merge 1 commit into
facebook:mainfrom
panagosg7:export-D82226987

Conversation

@panagosg7
Copy link
Copy Markdown
Contributor

Summary:
The previous condition typeof isESModule extends true in the definition of mockComponent is always true (this is expected by semantics of conditional types).

See try-Flow

A bug in Flow made it so that when this type was exported typeof isESModule became any, which made it so that the conditional always evaluated to the first part. The bug is fixed in D82193099.

This diff uses a type parameter, which can be correctly instantiated at the call site.

Changelog: [internal]

Differential Revision: D82226987

@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 11, 2025
@facebook-github-bot
Copy link
Copy Markdown
Contributor

This pull request was exported from Phabricator. Differential Revision: D82226987

@facebook-github-bot
Copy link
Copy Markdown
Contributor

This pull request has been merged in 3d4f0f4.

@react-native-bot
Copy link
Copy Markdown
Collaborator

This pull request was successfully merged by @panagosg7 in 3d4f0f4

When will my fix make it into a release? | How to file a pick request?

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. fb-exported Merged This PR has been merged. p: Facebook Partner: Facebook Partner

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants