Open mjstelly opened 6 years ago
You can fix this issue by first getting the actual width of the progress bar and then setting the percentage. If you set the percentage before the width it won't update the progress bar as there is a check added in componentDidUpdate callback if props.value is the same as prevProps.value then does nothing.
Version: "react-native-progress-bar-animated": "^1.0.6" RN: "react-native": "^0.55.3" Expected behavior: blue progress bar shows in the view Actual behavior: blue progress bar fails to show in the view
Use case: I need to set the progress bar width to a percentage value of its parent container, not on the whole window. When I replaced
barWidth
with a different calculation method,this.state.progress
(blue bar) no longer shows its value in the bar. I'm using theOnLayout
package to grab the width. I then use that derived value for thewidth
as follows:I tried to manually manipulate the width through the
onLayout
method with the same results.