Closed interstates21 closed 4 years ago
Also encountering this on both iOS and Android. I have pages of varying lengths, and want to keep a visual consistency by always having the page count, even if there is only one page.
I believe this error is caused by
const animateToPosition = (this.state.progressBarSize/ (stepCount - 1)) * position;
in onCurrentPositionChanged
When stepCount is 1, then it is dividing by zero, which results in an invalid value for the progressBar width.
No progress bar should be needed if there is only 1 step.
@interstates21 @SilverInfinity waiting for my PR #84 to merge which resolves this issue @24ark
Version 1.0.3 should fix this issue: https://github.com/24ark/react-native-step-indicator/blob/1df202c5f819b58445c2b1b99a0e08dc8398f4e0/src/index.tsx#L399