'Why is react-top-loading-bar by visible while coming back after its progress reaches 100

I am using react-top-loading-bar for my application like this:

<LoadingBar
    color="#007bff"
    progress={this.state.progress}
    onLoaderFinished={() => this.setProgress(0)}
/>

setProgress:

setProgress = (progress: number) => {
    this.setState({ progress: progress });
};

When I set the progress to 100, it fades away for half a second and is visible while coming back to zero. What is the reason for this? How can it be fixed?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source