petyosi / react-virtuoso

The most powerful virtual list component for React
https://virtuoso.dev
MIT License
5.13k stars 299 forks source link

[TYPE ERROR]: GridItem is missing some prop types #1053

Closed flbn closed 5 months ago

flbn commented 5 months ago

Not a bug, hence the title change. Just noticed in my project I'm missing some types for GridItemProps. wasn't exactly sure if this is done on purpose or not. If it's a bug, I can patch myself, just lmk. I'm type casting since it does log out as existing, and not including it actually results in an error.

Typed as this in the repo:

export declare interface GridItemProps {
    'data-index': number;
    className?: string;
}

If I log out the item props though, it is there:

Screenshot 2024-03-28 at 12 17 49 AM

Docs example for VirtuosoGrid actually make use of it, so looks like it's prob just been looked over?

petyosi commented 5 months ago

That's an omission indeed, happy to accept a PR that fixes it.

flbn commented 5 months ago

here's a PR sharing the same node types as the GridListProps: https://github.com/petyosi/react-virtuoso/pull/1054