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

Fix FlatList item generic types #5528

Merged

Conversation

jkadamczyk
Copy link
Contributor

Summary

I think I ran into a typescript types regression, where the Animated.FlatList type was no longer generic. It always used the any type and I couldn't provide a custom item type myself anymore. I found it while upgrading from Reanimated v2 to v3. I think I managed to patch the generated .d.ts file properly locally and this is what did the trick for me.

If this isn't matching your code style or requirements, I'm happy to work with you on making this work.

Test plan

Probably makes sense to see if it breaks anything in the example app but other than that 🤷

@jkadamczyk jkadamczyk force-pushed the @jkadamczyk/flatlist-generic-types branch from 8e2fc6d to 698d127 Compare December 27, 2023 14:13
Copy link
Collaborator

@tjzel tjzel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for finding that @jkadamczyk! I took the liberty and committed some minor changes directly into your PR. Everything looks well, apart from that one question that I asked. Once you assure me everything is fine I'm happy to merge it 😃

src/reanimated2/component/FlatList.tsx Show resolved Hide resolved
@tjzel tjzel added this pull request to the merge queue Dec 29, 2023
Merged via the queue into software-mansion:main with commit 9d365ae Dec 29, 2023
7 checks passed
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

Successfully merging this pull request may close these issues.

2 participants