MCPcopy Index your code
hub / github.com/adobe/react-spectrum / TabListInner

Function TabListInner

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

Source from the content-addressed store, hash-verified

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