From 9b4d4bd3f445b6c95a1aa58b68401ed38c6863cb Mon Sep 17 00:00:00 2001 From: Jakub Grzywacz Date: Fri, 27 Sep 2024 10:39:08 +0200 Subject: [PATCH 1/3] fix: disable dimming effect on tint by setting UIViewTintAdjustmentModeNormal --- apple/Elements/RNSVGSvgView.mm | 2 ++ 1 file changed, 2 insertions(+) diff --git a/apple/Elements/RNSVGSvgView.mm b/apple/Elements/RNSVGSvgView.mm index 3e36dc16d..f3448eefd 100644 --- a/apple/Elements/RNSVGSvgView.mm +++ b/apple/Elements/RNSVGSvgView.mm @@ -43,6 +43,8 @@ + (void)load - (instancetype)initWithFrame:(CGRect)frame { if (self = [super initWithFrame:frame]) { + // We don't want the dimming effect on tint as it's used as currentColor + self.tintAdjustmentMode = UIViewTintAdjustmentModeNormal; #if !TARGET_OS_OSX // Not available on macOS // This is necessary to ensure that [self setNeedsDisplay] actually triggers // a redraw when our parent transitions between hidden and visible. From 76b6c270666f56893b04278b0ffd44d5ca6cedd2 Mon Sep 17 00:00:00 2001 From: Jakub Grzywacz Date: Fri, 27 Sep 2024 10:45:11 +0200 Subject: [PATCH 2/3] refactor: move tintAdjustmentMode to !TARGET_OS_OSX --- apple/Elements/RNSVGSvgView.mm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/apple/Elements/RNSVGSvgView.mm b/apple/Elements/RNSVGSvgView.mm index f3448eefd..bbe74e741 100644 --- a/apple/Elements/RNSVGSvgView.mm +++ b/apple/Elements/RNSVGSvgView.mm @@ -43,12 +43,12 @@ + (void)load - (instancetype)initWithFrame:(CGRect)frame { if (self = [super initWithFrame:frame]) { - // We don't want the dimming effect on tint as it's used as currentColor - self.tintAdjustmentMode = UIViewTintAdjustmentModeNormal; #if !TARGET_OS_OSX // Not available on macOS // This is necessary to ensure that [self setNeedsDisplay] actually triggers // a redraw when our parent transitions between hidden and visible. self.contentMode = UIViewContentModeRedraw; + // We don't want the dimming effect on tint as it's used as currentColor + self.tintAdjustmentMode = UIViewTintAdjustmentModeNormal; #endif // TARGET_OS_OSX rendered = false; #ifdef RCT_NEW_ARCH_ENABLED From a3633d63503c8fa1bef1779fe6ae26dae36975dd Mon Sep 17 00:00:00 2001 From: Jakub Grzywacz Date: Fri, 27 Sep 2024 10:48:17 +0200 Subject: [PATCH 3/3] test: add Test2455 --- apps/test-examples/index.tsx | 1 + apps/test-examples/src/Test2455.tsx | 37 +++++++++++++++++++++++++++++ 2 files changed, 38 insertions(+) create mode 100644 apps/test-examples/src/Test2455.tsx diff --git a/apps/test-examples/index.tsx b/apps/test-examples/index.tsx index 740e5ddd0..d9afb126b 100644 --- a/apps/test-examples/index.tsx +++ b/apps/test-examples/index.tsx @@ -31,6 +31,7 @@ import Test2397 from './src/Test2397'; import Test2403 from './src/Test2403'; import Test2407 from './src/Test2407'; import Test2417 from './src/Test2417'; +import Test2455 from './src/Test2455'; export default function App() { return ; diff --git a/apps/test-examples/src/Test2455.tsx b/apps/test-examples/src/Test2455.tsx new file mode 100644 index 000000000..20cc06cc1 --- /dev/null +++ b/apps/test-examples/src/Test2455.tsx @@ -0,0 +1,37 @@ +import React from 'react'; +import {Button, Share, Text, TouchableOpacity, View} from 'react-native'; +import {G, Path, Rect, Svg} from 'react-native-svg'; + +const Favorite = ({color}: {color: string}): JSX.Element => { + return ( + + + + + + + + + + ); +}; + +export default () => { + const [color, setColor] = React.useState('green'); + return ( + + +