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

Dynamic percentage?

Open pepemiso16 opened this issue 5 years ago • 1 comments

Is there any way on how to make the percentage dynamic, let's say we are fetching data from the API and we are going to show this progress circle?

pepemiso16 avatar Dec 17 '19 07:12 pepemiso16

Yes this is possible. Simply pass a variable into the percent prop.

<ProgressCircle
  percent={value}  // | {this.state.value} | {(value / total) * 100}
  radius={50}
  borderWidth={8}
  color='#FFFFFF'
  shadowColor='#323838'
  bgColor='#000000'
>
  <Text>
    {value}
  </Text>
</ProgressCircle>

You may be able to use the Animated API, or a Timeout or Interval if you want it to run on a timer.

CantFayle avatar Jan 07 '20 16:01 CantFayle