react-native-web-community / react-native-web-lists

React Native for Web implementation of Lists
https://react-native-web-community.github.io/react-native-web-lists/storybook/
MIT License
31 stars 5 forks source link

Uncaught TypeError: scrollToOffset is not a function #5

Open seame1on opened 6 years ago

seame1on commented 6 years ago

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

Minishlink commented 6 years ago

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+