From 50f7804d2f49bfd9813434d6c7c588496002dcd3 Mon Sep 17 00:00:00 2001 From: Saad Najmi Date: Wed, 16 Nov 2022 06:05:01 -0800 Subject: [PATCH] Port Shadow props test page fix from React Native macOS (#35360) Summary: Cherry pick https://github.com/microsoft/react-native-macos/commit/19a62d9f57a6fae7a046741e19978a801f69abee to React Native. These style props were being applied to a element, not a element. They seemingly only worked because of a quirk of iOS. === Original change notes === The issue with the test is that the react native Text component has its own props for shadows - i.e. [textShadowColor, textShadowRadius, etc](https://reactnative.dev/docs/text-style-props) and the shadow props that View uses does not work on Text (i.e. shadowColor, shadowRadius, etc.). Not entirely sure how this test was passing without any errors before my change, it seems like something about the change is causing (expected) errors to actually show up. ## Changelog [Internal] [Fixed] - Shadow consistency opacity fix with test updates Pull Request resolved: https://github.com/facebook/react-native/pull/35360 Test Plan: Tested in our React Native macOS fork on iOS. Reviewed By: cipolleschi Differential Revision: D41335366 Pulled By: christophpurrer fbshipit-source-id: f789b9565ed4e00fa558af8e418dd9e078064f98 --- .../rn-tester/js/examples/AnimatedGratuitousApp/AnExSet.js | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/packages/rn-tester/js/examples/AnimatedGratuitousApp/AnExSet.js b/packages/rn-tester/js/examples/AnimatedGratuitousApp/AnExSet.js index 26e3b88dfbc..3a8ac0c3ee4 100644 --- a/packages/rn-tester/js/examples/AnimatedGratuitousApp/AnExSet.js +++ b/packages/rn-tester/js/examples/AnimatedGratuitousApp/AnExSet.js @@ -139,10 +139,9 @@ const styles = StyleSheet.create({ headerText: { fontSize: 25, color: 'white', - shadowRadius: 3, - shadowColor: 'black', - shadowOpacity: 1, - shadowOffset: {height: 1}, + textShadowRadius: 3, + textShadowColor: 'rgba(0, 0, 0, 1.0)', + textShadowOffset: {height: 1, width: 0}, }, });