Skip to content

Fix native component event property checks - #58195

Closed
OskarEichler wants to merge 1 commit into
react:mainfrom
OskarEichler:fix/native-component-event-own-check
Closed

OskarEichler wants to merge 1 commit into
react:mainfrom
OskarEichler:fix/native-component-event-own-check

Conversation

@OskarEichler

@OskarEichler OskarEichler commented Aug 30, 2026

Copy link
Copy Markdown
Contributor

Summary:

Legacy native component event merging invokes hasOwnProperty directly on native/default event maps. An own event named hasOwnProperty shadows that method and crashes component initialization. Use a bound intrinsic own-property check for both source and destination maps, and add an exact regression.

Hosted Flow caught two stale-server misses in the first patches: method unbinding/exact-object inference, then the deprecated mixed annotation. The final head uses the repository-standard suppression around the captured intrinsic and an explicit unknown indexer for the mutable test map.

Fixes #58194.

Changelog:

[GENERAL] [FIXED] - Handle native component event names that shadow Object prototype properties.

Test Plan:

  • Focused getNativeComponentAttributes Jest suite: 2 tests passed on the original regression/fix run.
  • Final-head targeted ESLint, Prettier check, and git diff --check passed.
  • Hosted full Flow/lint passed on the final amended head.

No UI change; screenshots are not applicable.

@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 Aug 30, 2026
@facebook-github-tools facebook-github-tools Bot added the Shared with Meta Applied via automation to indicate that an Issue or Pull Request has been shared with the team. label Aug 30, 2026
@OskarEichler
OskarEichler force-pushed the fix/native-component-event-own-check branch from 08dc8ad to 981b94b Compare August 30, 2026 07:59
@OskarEichler
OskarEichler force-pushed the fix/native-component-event-own-check branch from 981b94b to 9e9daef Compare August 30, 2026 08:05
@meta-codesync

meta-codesync Bot commented Sep 15, 2026

Copy link
Copy Markdown

@vzaidman has imported this pull request. If you are a Meta employee, you can view this in D120117546.

@meta-codesync meta-codesync Bot closed this in 665beff Sep 17, 2026
@meta-codesync meta-codesync Bot added the Merged This PR has been merged. label Sep 17, 2026
@meta-codesync

meta-codesync Bot commented Sep 17, 2026

Copy link
Copy Markdown

@vzaidman merged this pull request in 665beff.

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. Merged This PR has been merged. Shared with Meta Applied via automation to indicate that an Issue or Pull Request has been shared with the team.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Native component event maps can shadow hasOwnProperty and crash initialization

1 participant