recyclerlistview
recyclerlistview copied to clipboard
refreshControl causes onScroll to stop working on Android when using Reanimted ScrollView
Hello all,
I believe it is a known issue that assigning refreshControl while using reaniamted scrollview disables the onScroll prop. Is there any work arounds for this? Or is there a way we can provide some funding to accelerate the fix?
ANy luck yet?
No, it's really unfortunate because the performance of this library is outstanding. But with fabric coming out soon maybe we'll all go back to flatlist and never worry again
+1 you can check out my video result here in my response #654
Same here
I managed to fix this by using externalScrollView which extends BaseScrollView and passing the animated value via RecyclierListView scrollview props:
const animVal = new Animated.Value(0);
<RecyclerListView {...props} externalScrollView={ExternalScrollView as any} scrollViewProps={{ offsetY: animVal }} />
class ExternalScrollView extends BaseScrollView { scrollTo(...args) { if (this._scrollViewRef) { this._scrollViewRef.scrollTo(...args); } }
render = () => { return ( <Animated.ScrollView {...this.props} ref={scrollView => (this._scrollViewRef = scrollView)} onScroll={Animated.event( [ { nativeEvent: { contentOffset: { y: this.props.offsetY }, }, }, ], { useNativeDriver: true, listener: e => { //override the on scroll event listener here console.log(e) this.props.onScroll(e); }, } )} scrollEventThrottle={16} > {this.props.children} </Animated.ScrollView> ); }; }
Thank you for the tip but I am using reanimated, which I guess isn't fully supported yet