Typescript 财产';滚动索引';不存在于类型';平面列表<&燃气轮机';
我想了解此警告/错误的原因:Typescript 财产';滚动索引';不存在于类型';平面列表<&燃气轮机';,typescript,react-native,Typescript,React Native,我想了解此警告/错误的原因:类型“FlatList”上不存在“Property”scrollToIndex 我有一个本地快照转盘列表,应该在快照上滚动另一个列表 我为要滚动的列表创建了一个ref,该列表使用constschoorlist=useRef(null)进行滚动 用户使用ref={schoolList} 我的旋转木马是这样做的: <BottomCarousel ... onSnapToItem={(index) => { schoolList.current?
类型“FlatList”上不存在“Property”scrollToIndex
我有一个本地快照转盘列表,应该在快照上滚动另一个列表
我为要滚动的列表创建了一个ref,该列表使用constschoorlist=useRef(null)进行滚动代码>
用户使用ref={schoolList}
我的旋转木马是这样做的:
<BottomCarousel
...
onSnapToItem={(index) => {
schoolList.current?.scrollToIndex({ animated: false, index });
}}
/>
{
schoolList.current?.scrollToIndex({animated:false,index});
}}
/>
我得到的错误在这一行:schoolList.current?.scrollToIndex({animated:false,index})代码>
所以我做了一些挖掘<代码>滚动索引
用于平面列表。
我错过了什么