rn-vertical-slider icon indicating copy to clipboard operation
rn-vertical-slider copied to clipboard

crash when using reaniamted v3

Open fukemy opened this issue 1 year ago • 2 comments

Screenshot 2023-05-26 at 10 23 43

Can you update the dependency?

fukemy avatar May 26 '23 03:05 fukemy

I have created a patch file for supporting reanimated v3

diff --git a/node_modules/rn-vertical-slider/src/index.tsx b/node_modules/rn-vertical-slider/src/index.tsx
index f20ac03..c00fbad 100644
--- a/node_modules/rn-vertical-slider/src/index.tsx
+++ b/node_modules/rn-vertical-slider/src/index.tsx
@@ -87,7 +87,6 @@ const VerticalSlider: React.FC<SliderProps> = ({
   // Helper Variables
   const _moveStartValue = useSharedValue<number>(0);
   const _value = useSharedValue<number>(currentValue);
-  const value = new Animated.Value<number>(currentValue);
 
   // Calculating Values from props.value
   const calculateValues = () => {
@@ -126,7 +125,6 @@ const VerticalSlider: React.FC<SliderProps> = ({
   const updateNewValue = (newValue: number) => {
     let valueToUpdate = _clamp(newValue, min, max);
     _value.value = valueToUpdate;
-    value.setValue(valueToUpdate);
   };
 
   // PanResponder handlers
@@ -242,7 +240,7 @@ const VerticalSlider: React.FC<SliderProps> = ({
             <Animated.Text
               style={[styles.ballText, { color: ballIndicatorTextColor }]}
             >
-              {value}
+              {_value.value}
             </Animated.Text>
           )}
         </Animated.View>

iaroslav-ternovyi avatar Jul 03 '23 20:07 iaroslav-ternovyi

I can verify the patch works. Any idea if this will make it into a future version or are you concerned about dropping reanimated v2 support for the short term?

stuckj avatar Aug 30 '23 21:08 stuckj