Skip to content

fix(text): avoid mutating accessibilityState - #58318

Open
mfkrause wants to merge 1 commit into
react:mainfrom
mfkrause:fix/text-accessibility-state-mutation
Open

fix(text): avoid mutating accessibilityState#58318
mfkrause wants to merge 1 commit into
react:mainfrom
mfkrause:fix/text-accessibility-state-mutation

Conversation

@mfkrause

@mfkrause mfkrause commented Sep 3, 2026

Copy link
Copy Markdown

Summary:

When accessibilityState.disabled conflicts with an explicit disabled prop, the Text component currently updates accessibilityState in place. This mutates an object owned by the caller, which can cause issues when other code uses that same object.

This fix creates a new object instead, while retaining existing behavior (giving priority to the explicit prop).

Changelog:

[GENERAL] [FIXED] - Prevent Text from mutating the accessibilityState prop

Test Plan:

Unchanged tests pass + added a regression test

@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 3, 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 Sep 3, 2026
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. 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.

1 participant