react-native-web-lists icon indicating copy to clipboard operation
react-native-web-lists copied to clipboard

Uncaught TypeError: scrollToOffset is not a function

Open seame1on opened this issue 7 years ago • 1 comments

The problem I want to use scrollToOffset to let the FlatList component scroll to the specified location, but the console shows an error message that scrollToOffset is not a function

<Flatlist
  ref={ f => this.listView = f}
/>
...
this.listView.scrollToOffset({
  animated: false,
  offset: 0,
})

Environment

  • React Native for Web (version):0.5.4
  • React (version):16.0.0-alpha.12

seame1on avatar May 23 '18 09:05 seame1on

Thanks for the feedback. The refs are not forwarded in FlatList and SectionList. Can you send a PR?

Alternatively, try the new experimental FlatList of react-native-web 0.6+

Minishlink avatar May 24 '18 14:05 Minishlink