Closed NikiTsv closed 6 years ago
It should work, but call the function directly instead of ref.
Hey @stoffern , how do you call this function "directly" without a ref to the proper component then ?
yeah , what is the usage?
i think a find a way to deal with that issue.
pass that ref={(ref) => { this.flatListRef = ref; }} to OptimizedFlatList Component
create in OptimizedFlatList a scrollToIndex function and bind it in the constructor: like
this.scrollToIndex=this.scrollToIndex.bind(this)
.
your scrollToIndex function could look like:
scrollToIndex(){ // what ever you want to achieve }
you can call now this.flatListRef.scrollToIndex(index)
and the scrollToIndex function you have created in OptimizedFlatList, will trigger
I am not able to use scrollToIndex. Is that intended?
ref={(ref) => { this.flatListRef = ref; }}