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 overloads in createAnimatedComponent #5463

Merged
merged 3 commits into from
Dec 14, 2023

Conversation

Latropos
Copy link
Contributor

@Latropos Latropos commented Dec 4, 2023

Summary

  1. Move the overload with type deprecation to be the last one. It means that if user provides invalid type which isn't covered by any overload he will not get the warning about FlatList deprecation. This warning was very confusing if user wasn't using FlatList at all
  2. Add overload of ComponentType. Since ComponentType<P = {}> = ComponentClass<P> | FunctionComponent<P> we have assume that it is enough to have two overloads (ComponentClass & FunctionComponent), but it isn't
BEFORE AFTER
Error for FastImage and deprecation for FastImage ❌ Deprecation for FlatList only 😎
Screenshot 2023-12-12 at 13 16 37 image
image

Test plan

@Latropos Latropos requested a review from m-bert December 4, 2023 09:31
@Latropos Latropos marked this pull request as ready for review December 4, 2023 09:31
@Latropos Latropos requested a review from tjzel December 4, 2023 09:31
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.

Can you provide examples in the PR description that show why those changes are necessary?

@Latropos Latropos requested a review from tjzel December 12, 2023 12:22
@Latropos Latropos added this pull request to the merge queue Dec 14, 2023
Merged via the queue into main with commit 696a8c4 Dec 14, 2023
7 checks passed
@Latropos Latropos deleted the acynk/createAnimatedCOmponent-overload-fix branch December 14, 2023 14:33
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.

4 participants