I want to stop a ScrollView from scrolling in React Native. I don't want to completely disable it, I just want it to stop scrolling at a specific point, so that I can scroll it again afterwards.
Since the scrolling momentum still persists afterwards, I can't simply disable it when a certain condition is met, so the following code does not work.
<ScrollView
onScroll={e => {
if (e.nativeEvent.contentOffset.y > 500) {
setStopScroll(true)
}
}}
scrollEnabled={!stopScroll}
/>
I omitted the part in which is enabled the scroll view again to continue scrolling.