From 6d4b05a51bf44fb0feb45633ea1309336470a2a3 Mon Sep 17 00:00:00 2001 From: Kwonkunkun Date: Sat, 6 May 2023 15:59:38 +0900 Subject: [PATCH] fix: app crash when opcty slider is moved to 0 Motivation: - When the opacity slider is moved to 0, the app crashes - When the opacity slider is moved to 0, slider not visible Modifications: - add !! prefix check value - erase opacity value in logic conditional render (detail in the commit) --- .../src/brushProperties/BrushProperties.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/react-native-draw-extras/src/brushProperties/BrushProperties.tsx b/packages/react-native-draw-extras/src/brushProperties/BrushProperties.tsx index 2b09726..34d7fd0 100644 --- a/packages/react-native-draw-extras/src/brushProperties/BrushProperties.tsx +++ b/packages/react-native-draw-extras/src/brushProperties/BrushProperties.tsx @@ -126,7 +126,7 @@ const BrushProperties = forwardRef( colors={colors} onColorChange={onColorChange} /> - {thickness && onThicknessChange && opacity && onOpacityChange && ( + {!!thickness && !!onThicknessChange && !!onOpacityChange && ( {thickness && onThicknessChange && ( ( minimumTrackTintColor={sliderColor} /> )} - {opacity && onOpacityChange && ( + {onOpacityChange && (