react-native-big-list icon indicating copy to clipboard operation
react-native-big-list copied to clipboard

TypeScript type declarations missing for the methods

Open guicara opened this issue 3 years ago • 1 comments

Hello,

Thanks for this library.

FYI, the .d.ts file doesn't includes the type declarations for the custom methods as well as the FlatList methods.

const listRef = useRef<BigList>(null);

// This line return a TypeScript error:
// TS2339: Property 'scrollToSection' does not exist on type 'BigList '.
listRef.current?.scrollToSection({
    section: 0,
    animated: true,
});

<BigList ref={listRef} ... />

The temporary solution (but quiet ugly) is to set the comment line // @ts-ignore before the call of the methods.

Thanks

guicara avatar Dec 18 '21 02:12 guicara

I've added a pull request that I hope will solve this issue https://github.com/marcocesarato/react-native-big-list/pull/263

larsmunkholm avatar Oct 11 '22 20:10 larsmunkholm