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

Types issues with onResize #44

Closed
francisbourquestudyo opened this issue Mar 27, 2023 · 1 comment
Closed

Types issues with onResize #44

francisbourquestudyo opened this issue Mar 27, 2023 · 1 comment

Comments

@francisbourquestudyo
Copy link

We've just upgraded to version 1.0.9 and I've noticed that there is an issue with the types of onResize.

The parameter passed to the function is of type React.SyntheticEvent<HTMLDivElement, Event> | Size, which means that you cannot access the properties width and height directly as they don't exist on the SyntheticEvent.

To silence the Typescript error, we either needs to

  • Add a @ts-ignore
  • Cast the parameter like this (param as { width: number; height: number}).width)
bvaughn added a commit that referenced this issue Apr 2, 2023
@bvaughn
Copy link
Owner

bvaughn commented Apr 2, 2023

Ah, I see what this was. Sorry about that.

Fixed in 53dbe76

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