react-native-circular-progress icon indicating copy to clipboard operation
react-native-circular-progress copied to clipboard

Animated.Value in size prop is not working

Open mcasarrubios opened this issue 5 years ago • 3 comments

I open a new issue because this one is closed, but the problem is the same.

Supposedly size admits values of type Animated.value but I can't get it to work.

mcasarrubios avatar Aug 18 '20 17:08 mcasarrubios

I open a new issue because this one is closed, but the problem is the same.

Supposedly size admits values of type Animated.value but I can't get it to work.

Is just some type checking issue, I can quickly fix it up. The functionality should work as expect unless you used proptype to do runtime check then it's going to fail. If you want to animate the value, you are likely to add useNativeDriver: false

aboveyunhai avatar Aug 20 '20 20:08 aboveyunhai

Then maybe it's not the same issue as #193, my issue is this:

JSON value 'AnimatedCond, id: 7610' of type NSString cannot be converted to a YGValue. Did you forget the % or pt suffix?

I animate size with this:

const sizeAnimated = useMemo(
    () =>
      Animated.interpolate(fall, {
        inputRange: [0, 0.62, 1],
        outputRange: [width, 92, 92],
      }),
    [fall, width],
  );

And then I use it here:

<AnimatedCircularProgress
          size={sizeAnimated}
          width={8}
          fill={75}
          rotation={90}
          tintColor="#242424"
          backgroundColor="#c3c3c3"
          rotation={235}
          arcSweepAngle={250}
          useNativeDriver={false}
        />

I am not using proptypes. Have you got a working example where I can find out what I am doing wrong? Thanks for your time

mcasarrubios avatar Aug 21 '20 16:08 mcasarrubios

@mcasarrubios You probably have to search the official doc or stackoverflow by yourself to see how to use animated function. The interpolate function doesn't look right to me as doc example shows value.interpolate. And the bug report is something to do with your own code instead of the library issue. There is nothing I can do about. https://reactnative.dev/docs/animations.

aboveyunhai avatar Aug 21 '20 17:08 aboveyunhai