Types issues with onResize
francisbourquestudyo opened this issue · comments
Francis Bourque commented
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)
Brian Vaughn commented
Ah, I see what this was. Sorry about that.
Fixed in 53dbe76