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

Missing newHeight in typscript file #68

Closed
remijean opened this issue Mar 15, 2019 · 5 comments
Closed

Missing newHeight in typscript file #68

remijean opened this issue Mar 15, 2019 · 5 comments

Comments

@remijean
Copy link
Contributor

remijean commented Mar 15, 2019

My code :

<AnimateHeight
    duration={500}
    height={childrenHeight}
    onAnimationStart={newHeight => handleAnimationEnd(newHeight)}
>

Typescript return this error :

Type '(newHeight: any) => any' is not assignable to type '() => void'.ts(2322)

I believe that the declaration of newHeight is missing in the onAnimationEnd and onAnimationStart functions :

onAnimationEnd?(): void
onAnimationStart?(): void

to :

onAnimationEnd?(newHeight): void
onAnimationStart?(newHeight): void
@Stanko
Copy link
Owner

Stanko commented Mar 15, 2019

Hello @remijean,
Can you please check all of the type definitions and open a PR? So we can be sure no issues pop up in the future.
Thank you!

@remijean
Copy link
Contributor Author

Hello @Stanko, I just submitted the pull request ;) .

@Stanko
Copy link
Owner

Stanko commented Mar 15, 2019

Thank you very much! :)

I’m not near the laptop atm, but I will merge and publish it, first thing tomorrow morning.

@Stanko
Copy link
Owner

Stanko commented Mar 16, 2019

Published with 2.0.8 🎉

I made two small changes

Changed children: ReactNode; to children: ReactNode | ReactNode[];
as it can receive multiple children elements.

And changed easing?: "ease" | "linear" | "ease-in" | "ease-out" | "ease-in-out"; to
easing?: "ease" | "linear" | "ease-in" | "ease-out" | "ease-in-out" | string;
to support other timing functions like cubic-bezier and steps.

Cheers!

@Stanko Stanko closed this as completed Mar 16, 2019
@remijean
Copy link
Contributor Author

Thanks you Stanko ! 👍

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