({
collection,
...props
}: AriaTagGroupProps<object> &
Omit<ListProps<object>, 'children'> & {
label?: ReactNode;
collection: ICollection<Node<object>>;
})
| 71 | } |
| 72 | |
| 73 | function TagGroupInner({ |
| 74 | collection, |
| 75 | ...props |
| 76 | }: AriaTagGroupProps<object> & |
| 77 | Omit<ListProps<object>, 'children'> & { |
| 78 | label?: ReactNode; |
| 79 | collection: ICollection<Node<object>>; |
| 80 | }) { |
| 81 | let ref = useRef<HTMLDivElement>(null); |
| 82 | let state = useListState({...props, collection, children: undefined}); |
| 83 | /*- begin highlight -*/ |
| 84 | let {gridProps, labelProps} = useTagGroup(props, state, ref); |
| 85 | /*- end highlight -*/ |
| 86 | |
| 87 | return ( |
| 88 | <div className="react-aria-TagGroup"> |
| 89 | {props.label && ( |
| 90 | <span {...labelProps} className="react-aria-Label"> |
| 91 | {props.label} |
| 92 | </span> |
| 93 | )} |
| 94 | <div {...gridProps} ref={ref} className="react-aria-TagList"> |
| 95 | <ListStateContext.Provider value={state}> |
| 96 | {[...state.collection].map(item => ( |
| 97 | <Fragment key={item.key}>{item.render!(item)}</Fragment> |
| 98 | ))} |
| 99 | </ListStateContext.Provider> |
| 100 | </div> |
| 101 | </div> |
| 102 | ); |
| 103 | } |
nothing calls this directly
no test coverage detected