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

Function TabPanel

packages/@react-spectrum/s2/src/Tabs.tsx:572–592  ·  view source on GitHub ↗
(props: TabPanelProps)

Source from the content-addressed store, hash-verified

570);
571
572export function TabPanel(props: TabPanelProps): ReactNode | null {
573 let {showTabs} = useContext(CollapseContext);
574 let {selectedKey} = useContext(InternalTabsContext);
575 if (showTabs) {
576 return (
577 <AriaTabPanel
578 {...props}
579 style={props.UNSAFE_style}
580 className={renderProps =>
581 (props.UNSAFE_className ?? '') + tabPanel(renderProps, props.styles)
582 }
583 />
584 );
585 }
586
587 if (props.id !== selectedKey) {
588 return null;
589 }
590
591 return <CollapsedTabPanel {...props} />;
592}
593
594function CollapsedTabPanel(props: TabPanelProps) {
595 // eslint-disable-next-line @typescript-eslint/no-unused-vars

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected