({
collection,
...props
}: AriaTabListOptions<object> &
Omit<TabListStateOptions<object>, 'children'> & {
collection: ICollection<Node<object>>;
})
| 62 | } |
| 63 | |
| 64 | function TabsInner({ |
| 65 | collection, |
| 66 | ...props |
| 67 | }: AriaTabListOptions<object> & |
| 68 | Omit<TabListStateOptions<object>, 'children'> & { |
| 69 | collection: ICollection<Node<object>>; |
| 70 | }) { |
| 71 | let state = useTabListState({...props, collection, children: undefined}); |
| 72 | let ref = useRef<HTMLDivElement>(null); |
| 73 | /*- begin highlight -*/ |
| 74 | let {tabListProps} = useTabList(props, state, ref); |
| 75 | /*- end highlight -*/ |
| 76 | let orientation = props.orientation || 'horizontal'; |
| 77 | |
| 78 | return ( |
| 79 | <div className="react-aria-Tabs" data-orientation={orientation}> |
| 80 | <div |
| 81 | {...tabListProps} |
| 82 | ref={ref} |
| 83 | className="react-aria-TabList" |
| 84 | data-orientation={orientation}> |
| 85 | <TabListStateContext.Provider value={state}> |
| 86 | {[...state.collection].map(item => ( |
| 87 | <Fragment key={item.key}>{item.render!(item)}</Fragment> |
| 88 | ))} |
| 89 | </TabListStateContext.Provider> |
| 90 | </div> |
| 91 | {/* Re-mount the panel when the selection changes so DOM state isn't shared between tabs. */} |
| 92 | <TabPanel key={state.selectedItem?.key} state={state} /> |
| 93 | </div> |
| 94 | ); |
| 95 | } |
| 96 | |
| 97 | function TabPanel({state, ...props}: {state: TabListState<object>}) { |
| 98 | let ref = useRef<HTMLDivElement>(null); |
nothing calls this directly
no test coverage detected