Closed greatwitenorth closed 7 years ago
I wonder if it could make use of react-native-scrollable-mixin. I think this basically does what you're describing and passes scrollTo to the relevant inner scrollview-like ref.
I'm a bit unclear on how I'd use that to access the underlying scrollTo functionality of ListView. Wouldn't scrollable-mixin need to be implemented in SGListView.js?
Sorry for the vagueness. Yes, that's correct. It's not magic but at least exposes a common interface so that these things mostly just work.
So I was able to implement the mixin easy enough by simply copying you library files into my project and adding the mixin. The trouble is when I scroll to a section in the list it appears to loose all the memory reducing benefits of SGLists. My memory is now climbing in a linear fashion like before. Is this because the scrollTo method is circumventing your memory management methods?
@greatwitenorth you can use the underlying scrollTo in 2 ways:
sglistviewRef.getScrollResponder().scrollTo
sglistviewRef.getNativeListView().scrollTo
IMO the first appraoch is the best because it works both for ListView and SGListView
@gre's approach worked perfectly, thanks Gaetan!
Why is this issue still open? The method using getScrollResponder()
works perfectly 👍
fixed:
sglistviewRef.getScrollResponder().scrollTo sglistviewRef.getNativeListView().scrollTo
thanks @gre
Thanks all. Closing
I was hoping for SGListview to be a drop in replacement for ListView. I'm using the scrollTo method to scroll to different portions of the list. Is this not support with SGListview?