bvaughn / react-virtualized-auto-sizer

Standalone version of the AutoSizer component from react-virtualized
MIT License
603 stars 82 forks source link

fix: correct boolean types #71

Closed samtjo closed 1 year ago

samtjo commented 1 year ago

Fixes: https://github.com/bvaughn/react-virtualized-auto-sizer/issues/70

Correcting the boolean types, as true and false aren't valid TypeScript types

bvaughn commented 1 year ago

as true and false aren't valid TypeScript types

This is incorrect. Boolean is a type that includes either true or false. true or false as a hard-coded value is just a constraint (same as you can provide a fixed string or number etc).

The reason this type has the permutations is that:

  1. It makes no sense for both width and height to be disabled (so true+true would be an invalid combination)
  2. To better match up the params passed to the onResize callback