bvaughn / react-virtualized-auto-sizer

Standalone version of the AutoSizer component from react-virtualized

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Typings for conditional `disableHeight` and `disableWidth`

DenizUgur opened this issue · comments

These props should accept boolean and children props type can utilize Partial if there is no better option.

The types were intentionally chosen as explained in comments like this one #71 (comment). It's okay if you don't agree, but I'm not going to change them based on a subjective assertion.

I understand that you may not want to change it. It's just that following use case works without a problem but types indicate there is a problem. I see this as a reasonable use case for responsiveness. If you have any other suggestion, please let me know.

<AutoSizer disableHeight={mobile}>
    {({ height, width }) => {
        return (
            <List
                height={height || 500}
                itemCount={items.length}
                itemData={items}
                itemSize={26}
                width={width}
            >
                {Row}
            </List>
        );
    }}
</AutoSizer>