Open erdemildiz opened 4 years ago
Does it work when you do this.dataListRef.current.scrollToOffset({animated: true, offset: 0)}
?
I am sorry, It didn't worked. @shauns
May be a better solution, but managed to get it working by doing the following:
this.dataListRef.current.ref.getNode().scrollToOffset(...);
The getNode()
should return the actual element (FlatList in this example) so you can use the methods on it.
I am using blow code block, but I am getting
dataListRef.scrollToOffset is not a function. (In 'dataListRef.scrollToOffset({ animated: true, offset: 0 })', 'dataListRef.scrollToOffset' is undefined)
error when I try this