MCPcopy Create free account
hub / github.com/adobe/react-spectrum / TabListInner

Function TabListInner

packages/react-aria-components/src/Tabs.tsx:346–393  ·  view source on GitHub ↗
({props, forwardedRef: ref}: TabListInnerProps<T>)

Source from the content-addressed store, hash-verified

344}
345
346function TabListInner<T>({props, forwardedRef: ref}: TabListInnerProps<T>) {
347 let state = useContext(TabListStateContext)!;
348 let {CollectionRoot} = useContext(CollectionRendererContext);
349 let {
350 orientation = 'horizontal',
351 keyboardActivation = 'automatic',
352 shouldFocusWrap
353 } = useSlottedContext(TabsContext)!;
354 let objectRef = useObjectRef(ref);
355
356 let {tabListProps} = useTabList(
357 {
358 ...props,
359 orientation,
360 keyboardActivation,
361 shouldFocusWrap
362 },
363 state,
364 objectRef
365 );
366
367 let renderProps = useRenderProps({
368 ...props,
369 children: null,
370 defaultClassName: 'react-aria-TabList',
371 values: {
372 orientation,
373 state
374 }
375 });
376
377 let DOMProps = filterDOMProps(props, {global: true});
378 delete DOMProps.id;
379
380 return (
381 <dom.div
382 {...mergeProps(DOMProps, renderProps, tabListProps)}
383 ref={objectRef}
384 data-orientation={orientation || undefined}>
385 <SharedElementTransition>
386 <CollectionRoot
387 collection={state.collection}
388 persistedKeys={usePersistedKeys(state.selectionManager.focusedKey)}
389 />
390 </SharedElementTransition>
391 </dom.div>
392 );
393}
394
395class TabItemNode extends CollectionNode<unknown> {
396 static readonly type = 'item';

Callers

nothing calls this directly

Calls 7

useSlottedContextFunction · 0.90
useObjectRefFunction · 0.90
useTabListFunction · 0.90
useRenderPropsFunction · 0.90
filterDOMPropsFunction · 0.90
mergePropsFunction · 0.90
usePersistedKeysFunction · 0.90

Tested by

no test coverage detected