左右联动列表
程序员文章站
2022-06-15 22:43:58
...
render(): React.Node {
return (
<VirtualizedSectionList
{...this.props}
ref={this._captureRef}
getItemCount={items => items.length}
getItem={(items, index) => items[index]}
/>
);
}
_wrapperListRef: ?React.ElementRef<typeof VirtualizedSectionList>;
_captureRef = ref => {
/* $FlowFixMe(>=0.99.0 site=react_native_fb) This comment suppresses an
* error found when Flow v0.99 was deployed. To see the error, delete this
* comment and run Flow. */
this._wrapperListRef = ref;
};
/****************************************
scrollToIndex = (params: {animated ?: ? boolean, index: number, viewPosition?: number }) => {
this._wrapperListRef.scrollToIndex(params);}
********************************************/
根据搜索到的rn左右联动,修改源码,注意添加/*****/中的代码
上一篇: nginx:nginx+lua+redis构建高并发应用
下一篇: git