-
Notifications
You must be signed in to change notification settings - Fork 521
Closed
Description
Describe the bug
Typescript error: Property scrollToOffset does not exist on type SwipeListView<MyType> where the object is the ref parameter in the listViewRef function.
let listViewRef: SwipeListView<MyType> | null = null;
<SwipeListView
...
listViewRef={(ref) => {
// type of ref is SwipeListView as defined here https://github.com/jemise111/react-native-swipe-list-view/blob/master/types/index.d.ts#L395
listViewRef = ref;
}}
/>
...
// This works fine at runtime. Typescript is showing an error that scrollToOffset does not exist
listViewRef?.scrollToOffset({
x: 0,
y: 0,
animated: true,
});
Environment:
- OS: Mac using Expo, testing on iOS simulator
- RNSLV Version: 3.1.0
- RN Version: 0.61
Metadata
Metadata
Assignees
Labels
No labels