diff --git a/packages/react-native/React/Fabric/Mounting/ComponentViews/View/RCTViewComponentView.mm b/packages/react-native/React/Fabric/Mounting/ComponentViews/View/RCTViewComponentView.mm index 38f3da01ca769c..d06b0aa8d1c2bf 100644 --- a/packages/react-native/React/Fabric/Mounting/ComponentViews/View/RCTViewComponentView.mm +++ b/packages/react-native/React/Fabric/Mounting/ComponentViews/View/RCTViewComponentView.mm @@ -371,6 +371,11 @@ - (void)updateProps:(const Props::Shared &)props oldProps:(const Props::Shared & self.accessibilityIdentifier = RCTNSStringFromString(newViewProps.testId); } + // `zIndex` + if (oldViewProps.zIndex != newViewProps.zIndex) { + self.layer.zPosition = newViewProps.zIndex.value_or(0); + } + _needsInvalidateLayer = _needsInvalidateLayer || needsInvalidateLayer; _props = std::static_pointer_cast(props); diff --git a/packages/rn-tester/js/examples/Transform/TransformExample.js b/packages/rn-tester/js/examples/Transform/TransformExample.js index d0a2e7113c5e79..48ac0e0e4be6ee 100644 --- a/packages/rn-tester/js/examples/Transform/TransformExample.js +++ b/packages/rn-tester/js/examples/Transform/TransformExample.js @@ -255,6 +255,7 @@ const styles = StyleSheet.create({ justifyContent: 'center', backgroundColor: 'blue', backfaceVisibility: 'hidden', + zIndex: 1024, }, flipCard1: { position: 'absolute',