-
-
Notifications
You must be signed in to change notification settings - Fork 80
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
AutoSizer height and width changed from type number
to number | undefined
in 1.0.8
#52
Comments
This is a duplicate of issue #45 Sorry for the inconvenience, but the new For now, I'd recommend just casting the type. |
@bvaughn yes, this can be solved with generics and overloads, but TypeScript does not support class overloading, only functions. I tried writing function declarations (if your component were a function), and they work fine - depending on the settings of I tried to rewrite the component to a function, but judging by the tests, there are unnecessary calls to some functions (although they look logical, on the contrary, I'm surprised that they are not in the current implementation). |
Feel free to share what you're referring to- regarding the functional exploration. Not sure what to make of your comment without any code to reference |
@bvaughn sure: https://github.com/dartess/react-virtualized-auto-sizer/commits/fc |
Gotcha. Migrating to a function component would be nice. Didn't look too close at this. Looks like your |
I'm using
react-virtualized-auto-sizer
along withreact-window
and there was a breaking change in 1.0.8: theheight
andwidth
values provided byAutoSizer
are nownumber | undefined
and can't be passed down directly toFixedSizeList
fromreact-window
. Thereact-window
list components expectnumber | string
and won't allowundefined
.Here's a codesandbox showing the issue, you can change the installed version between 1.0.7 and 1.0.8 to see the difference:
https://codesandbox.io/s/weathered-silence-op15io?file=/src/App.tsx
I can default the values to
0
ifAutoSizer
gives meundefined
and it seems to work, is this the recommended solution? It would be ideal if theAutoSizer
values matched the list props fromreact-window
but it would be helpful to know the right thing to do ifAutoSizer
gives anundefined
width
orheight
.Thanks!
The text was updated successfully, but these errors were encountered: