question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Missing newHeight in typscript file

See original GitHub issue

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

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:5 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
Stankocommented, 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!

0reactions
remijeancommented, Mar 18, 2019

Thanks you Stanko ! 👍

Read more comments on GitHub >

github_iconTop Results From Across the Web

Typescript: Type X is missing the following properties from ...
angular - Typescript: Type X is missing the following properties from type Y length, pop, push, concat, and 26 more. [2740] - Stack...
Read more >
[1.3.0] Typescript file missing GetCroppedCanvasOptions ...
I'm submitting a... [X ] Bug report · Current behavior. If I'm not wrong, the typescript file included with v1. · Expected behavior....
Read more >
Documentation - TypeScript for JavaScript Programmers
By understanding how JavaScript works, TypeScript can build a type-system that accepts JavaScript code but has types. This offers a type-system without needing ......
Read more >
TypeScript - Emotion
The easiest way to use the css prop with TypeScript is with the new JSX ... const subtitleStyle = css` box-sizing: border-box; width:...
Read more >
Ninja Squad: Le Blog
The CLI now generates fewer files in a new project: the environment files are gone, so you'll no longer see environment.ts and ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found