From 3e343db0cb1490f5a03164d258230a2f9aa0a253 Mon Sep 17 00:00:00 2001 From: Vojtech Novak Date: Tue, 7 Apr 2020 00:01:28 +0200 Subject: [PATCH] second attempt --- .../Components/Pressable/useAndroidRippleForView.js | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/Libraries/Components/Pressable/useAndroidRippleForView.js b/Libraries/Components/Pressable/useAndroidRippleForView.js index b8b6e283ea4680..e03693bfcf2c12 100644 --- a/Libraries/Components/Pressable/useAndroidRippleForView.js +++ b/Libraries/Components/Pressable/useAndroidRippleForView.js @@ -47,13 +47,10 @@ export default function useAndroidRippleForView( |}>, |}> { const {color, borderless, radius} = rippleConfig ?? {}; + const normalizedBorderless = borderless === true; return useMemo(() => { - if ( - Platform.OS === 'android' && - Platform.Version >= 21 && - (color != null || borderless != null || radius != null) - ) { + if (Platform.OS === 'android' && Platform.Version >= 21) { const processedColor = processColor(color); invariant( processedColor == null || typeof processedColor === 'number', @@ -66,7 +63,7 @@ export default function useAndroidRippleForView( nativeBackgroundAndroid: { type: 'RippleAndroid', color: processedColor, - borderless: borderless === true, + borderless: normalizedBorderless, rippleRadius: radius, }, }, @@ -100,5 +97,5 @@ export default function useAndroidRippleForView( }; } return null; - }, [color, borderless, radius, viewRef]); + }, [color, normalizedBorderless, radius, viewRef]); }