scrollToLocatoin 不是函数:react-native-swipe-list-view

scrollToLocatoin is not a function : react-native-swipe-list-view

我正在尝试通过点击按钮实现滚动到顶部功能以滚动到滑动列表视图的顶部位置并尝试从 SectionList 访问方法 scrollToLocation 但我无法使用 SwipeListView 的引用访问它。所以我需要帮助如何实现 it.Below 是来自渲染函数的代码。

<SwipeListView
                    useSectionList={true}
                    sections={this.state.data}
                    keyExtractor={(item, section) => item.key }
                    renderItem={this.renderRow}
                    renderHiddenItem={this.renderHiddenItems}
                    renderSectionHeader={this.renderSectionHeader}
                    rightOpenValue={-75}
                    stopRightSwipe={-75}
                    previewRowKey={'0'}
                    closeOnRowPress={true}
                    previewOpenValue={-40}
                    onRowDidOpen={this.onRowDidOpen}
                    stickySectionHeadersEnabled={false}
                    bounces
                    disableRightSwipe={true}
                    enableEmptySections={false}
                    tension={20}
                    scrollsToTop={true}
                    onEndReachedThreshold={0.99}
                    onEndReached={() => {
                      this.setState({ isScrollToTopVisible: !this.state.isScrollToTopVisible })
                    }}
                    ref={(ref) => this.sectionListRef = ref }
    />

滚动到列表顶部的代码。

scrollToTop() {
   this.sectionListRef.scrollToLocation({ offset : 0, animated : true })
}

OS: iOS 12.1

React Native 版本:v0.59.8

React-native-swipe-list-view 版本:v2.0.3

列表视图参考​​:listViewRef ={ ref => this.sectionListRef = ref }

and 和 scrolltop 函数应该是这样的:

scrollToTop() {
   this.sectionListRef.scrollToLocation({
            animated: true,
            itemIndex: 0,
            sectionIndex: 0,
            viewOffset: 0,
        });
}