Fix accessibilityState serialization for props diffing of View component (#51420)

Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51420

The checked and unchecked state of the accessibility state property has to be serialized as `{ "checked": true }` and `{"checked": false}`.

This diff updates the serialization of the `accessibilityState` prop for the prop diffing on the View component.

This fixes the e2e test selectors for radio buttons.

Changelog: [Internal]

Reviewed By: rshest

Differential Revision: D74910744

fbshipit-source-id: 212b78e29a007744ac9283c7ec9b96ce80fd5681
This commit is contained in:
Nick Lefever
2025-05-19 03:12:48 -07:00
committed by Facebook GitHub Bot
parent 01db5aa230
commit f278c94a12
@@ -475,10 +475,10 @@ inline static void updateAccessibilityStateProp(
if (!oldState.has_value() || newState->checked != oldState->checked) {
switch (newState->checked) {
case AccessibilityState::Unchecked:
resultState["checked"] = "unchecked";
resultState["checked"] = false;
break;
case AccessibilityState::Checked:
resultState["checked"] = "checked";
resultState["checked"] = true;
break;
case AccessibilityState::Mixed:
resultState["checked"] = "mixed";