bvaughn / react-virtualized-auto-sizer

Standalone version of the AutoSizer component from react-virtualized

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Types issues with onResize

francisbourquestudyo opened this issue · comments

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)

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

Fixed in 53dbe76