({ contacts }: { contacts: Contact[] })
| 11 | } from "react-window"; |
| 12 | |
| 13 | function Example({ contacts }: { contacts: Contact[] }) { |
| 14 | const [list, setList] = useListCallbackRef(null); |
| 15 | const isScrolling = useIsScrolling(list?.element); |
| 16 | |
| 17 | return ( |
| 18 | <div className="h-full flex flex-col gap-2"> |
| 19 | <List |
| 20 | listRef={setList} |
| 21 | rowComponent={RowComponent} |
| 22 | rowCount={contacts.length} |
| 23 | rowHeight={50} |
| 24 | rowProps={{ contacts, isScrolling }} |
| 25 | /> |
| 26 | </div> |
| 27 | ); |
| 28 | } |
| 29 | |
| 30 | function RowComponent({ |
| 31 | ariaAttributes, |
nothing calls this directly
no test coverage detected