Skip to content
This repository has been archived by the owner on Jan 3, 2021. It is now read-only.

Dynamic percentage? #39

Open
pepemiso16 opened this issue Dec 17, 2019 · 1 comment
Open

Dynamic percentage? #39

pepemiso16 opened this issue Dec 17, 2019 · 1 comment

Comments

@pepemiso16
Copy link

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?

@CantFayle
Copy link

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.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants