Open caner219 opened 4 months ago
Can you please follow the example and give it a try?
export const Example = () => {
const progress = useSharedValue(30);
const min = useSharedValue(0);
const max = useSharedValue(100);
return (
<Slider
style={styles.container}
progress={progress}
minimumValue={min}
maximumValue={max}
/>
);
};
I made the changes as you suggested, but the progress bar's progress is still not refreshing. The printed value of "progressValue called with = " is changing, but the progress bar itself is still not changing.
but the progress bar's progress is still not refreshing.
Are you saying that you have already dragged the thumb, but the slider did not change at all?
When I manually drag the progress bar, that works fine. The problem is when I get the data from the server and then go to set the progress value, the progress value changes but the progress bar UI does not refresh, it stays at the initial value it was set to.
maybe this will help you :)
export const Example = () => {
const progress = useSharedValue(30);
const min = useSharedValue(0);
const max = useSharedValue(100);
return (
<Slider
style={styles.container}
progress={progress}
minimumValue={min}
maximumValue={max}
cache={progress}
/>
);
};
Hi,I made the modifications as you instructed, but the UI of progress still has not refreshed.
@caner219 Any luck with this?
I am facing the same issue.... anyone found the solution?
@caner219, doesn't it work for you if you set the progress
SharedValue? Typically, if you only want to change the progress value, you can simply do progress.value = number;
.
I had a similar issue when trying to use the Slider inside a modal. I couldn't get the progress spot to change based on parameters passed into the modal. I think it has something to do with useSharedValue variables updating asynchronously.
Here is a link to the documentation (the first code block under remarks is where the problem comes from I think), https://docs.swmansion.com/react-native-reanimated/docs/core/useSharedValue/
Having the same problem here, you can just repro the issue with a button setting the sharedValue in progress. It does not update the slider.
When setting the value of progress for the first time, it takes effect. However, when I retrieve data from the server and want to display it on the progress bar, the progress does not refresh. How can I solve this issue?