Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TypeScript type declarations missing for the methods #119

Open
guicara opened this issue Dec 18, 2021 · 1 comment
Open

TypeScript type declarations missing for the methods #119

guicara opened this issue Dec 18, 2021 · 1 comment

Comments

@guicara
Copy link

guicara commented Dec 18, 2021

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

@larsmunkholm
Copy link
Contributor

I've added a pull request that I hope will solve this issue
#263

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants