From 93b37350afe8db7b4835ba59f40ea1e55e4a3045 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hanno=20J=2E=20G=C3=B6decke?= Date: Tue, 31 Mar 2026 18:01:10 -0700 Subject: [PATCH] fix(android): fix `bad_optional_access` when `zIndex` changes to undefined with props 2.0 (#56288) Summary: When Android props 2.0 diffs a `View` where `zIndex` changes from a value to `undefined`, `HostPlatformViewProps::getDiffProps` calls `zIndex.value()` and throws `bad_optional_access`: https://github.com/user-attachments/assets/89752243-ff48-42c7-a584-b47a091b4a4d This change emits `folly::dynamic(nullptr)` when `zIndex` is cleared instead. ## Changelog: [ANDROID] [FIXED] - Fixed a crash when clearing `zIndex` with props 2.0 enabled Pull Request resolved: https://github.com/facebook/react-native/pull/56288 Test Plan: Use the repro in `packages/rn-tester/js/examples/Playground/RNTesterPlayground.js`: ```js function Playground() { const [toggle, setToggle] = React.useState(false); return (