react-native-progress-circle
react-native-progress-circle copied to clipboard
Dynamic percentage?
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?
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.