({
collection,
...props
}: AriaListBoxOptions<object> &
Omit<ListProps<object>, 'children'> & {collection: ICollection<Node<object>>})
| 58 | } |
| 59 | |
| 60 | function ListBoxInner({ |
| 61 | collection, |
| 62 | ...props |
| 63 | }: AriaListBoxOptions<object> & |
| 64 | Omit<ListProps<object>, 'children'> & {collection: ICollection<Node<object>>}) { |
| 65 | /*- begin highlight -*/ |
| 66 | let state = useListState({...props, collection, children: undefined}); |
| 67 | let ref = useRef<HTMLDivElement>(null); |
| 68 | let {listBoxProps} = useListBox(props, state, ref); |
| 69 | /*- end highlight -*/ |
| 70 | |
| 71 | return ( |
| 72 | <div |
| 73 | {...listBoxProps} |
| 74 | ref={ref} |
| 75 | className="react-aria-ListBox" |
| 76 | data-layout="stack" |
| 77 | data-orientation="vertical"> |
| 78 | <ListStateContext.Provider value={state}> |
| 79 | {[...state.collection].map(item => ( |
| 80 | <Fragment key={item.key}>{item.render!(item)}</Fragment> |
| 81 | ))} |
| 82 | </ListStateContext.Provider> |
| 83 | </div> |
| 84 | ); |
| 85 | } |
nothing calls this directly
no test coverage detected