Fix NativeSyntheticEvent compatibility with BaseSyntheticEvent - #58002
Open
97Fakhreddine wants to merge 3 commits into
Open
Fix NativeSyntheticEvent compatibility with BaseSyntheticEvent#5800297Fakhreddine wants to merge 3 commits into
97Fakhreddine wants to merge 3 commits into
Conversation
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.
Summary:
Fixes #57910.
The generated strict TypeScript definition of
NativeSyntheticEventallowedundefinedfor standardBaseSyntheticEventfields such asbubbles,cancelable, anddefaultPrevented. This made React Native event handlers incompatible with shared handlers acceptingReact.BaseSyntheticEvent, despite the legacy React Native definition extending that React type directly.This change aligns the standard event fields with the React synthetic event contract and adds a type test that assigns a React Native event to
React.BaseSyntheticEvent. The committed generated API snapshot is updated to match the Flow source.Changelog:
[GENERAL] [FIXED] - Restore
NativeSyntheticEventcompatibility with ReactBaseSyntheticEventin the strict TypeScript APITest Plan:
@types/react19.2.3.packages/react-native/__typetests__/index.tsx.yarn test-generated-typescript