我正在使用这个组件:https://github.com/meliorence/react-native-snap-carousel该组件使用的是FlatList,因此我可以在其中使用从FlatList派生的方法,例如onEndReached:
import BottomCarousel from 'react-native-snap-carousel';
<BottomCarousel
onEndReached={loadMore} // << This gives a TS error
...但是,该库并没有扩展这些方法的typescript定义,因此我得到了一个错误Property 'onEndReached' does not exist on type 'IntrinsicAttributes &...
如何在不接触原始组件的情况下,将这些TS定义包含在视图中加载的组件中?
发布于 2021-03-11 17:39:32
库的类型安装好了吗?$ npm install --save @types/react-native-snap-carousel
https://stackoverflow.com/questions/66573214
复制相似问题