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

feature-request: turn off animation

Open yepMad opened this issue 2 years ago • 4 comments

It would be interesting to have the ability to turn off the animation, the component works only statically. This is very useful for list in order to optimize loading.

yepMad avatar Sep 19 '22 03:09 yepMad

@yepMad Have you tried setting duration={0} ? Does that do the trick for you?

jordiboehme avatar Nov 29 '22 23:11 jordiboehme

Hello! @jordiboehme I am not the original requester of this feature, however, I have found that my team would also benefit from this feature.

I have tried using duration={0} within my <CircularProgress /> component, but it does not prevent the component from animating.

I was hoping to use the prop startInPausedState, which is defined in the docs as part of the CircularProgressBase Props that are accessible to CircularProgress, but I am getting a TS error that seems to suggest otherwise.

Type '{ allowFontScaling: true; value: number; radius: number; activeStrokeColor: string | undefined; inActiveStrokeColor: string | undefined; showProgressValue: false; title: string; titleStyle: { ...; }; onAnimationComplete: () => void; startInPausedState: boolean; }' is not assignable to type 'IntrinsicAttributes & CircularProgressProps & RefAttributes<ProgressRef>'.
  Property 'startInPausedState' does not exist on type 'IntrinsicAttributes & CircularProgressProps & RefAttributes<ProgressRef>'.ts(2322)

dinayrore avatar Dec 08 '22 20:12 dinayrore

startInPaused will not be useful in this use-case as it would just keep the progress at 0 until play or reAnimate is called. Duration 0 would also might not be a good idea as it will still run the animation but with a duration of 0. How about adding a simple circle progress without any of the animation overhead as a separate component, say StaticProgress?.

nithinpp69 avatar Dec 09 '22 11:12 nithinpp69

How about adding a simple circle progress without any of the animation overhead as a separate component, say StaticProgress?.

Would be great to have this

jorgegvallejo avatar Feb 09 '23 15:02 jorgegvallejo