(props)
| 129 | } |
| 130 | |
| 131 | const Tabs: React.FC<TabsProps> = (props) => { |
| 132 | const { |
| 133 | id, |
| 134 | onSelect, |
| 135 | transition, |
| 136 | mountOnEnter = false, |
| 137 | unmountOnExit = false, |
| 138 | variant = 'tabs', |
| 139 | children, |
| 140 | activeKey = getDefaultActiveKey(children), |
| 141 | ...controlledProps |
| 142 | } = useUncontrolled(props, { |
| 143 | activeKey: 'onSelect', |
| 144 | }); |
| 145 | |
| 146 | return ( |
| 147 | <BaseTabs |
| 148 | id={id} |
| 149 | activeKey={activeKey} |
| 150 | onSelect={onSelect} |
| 151 | transition={getTabTransitionComponent(transition)} |
| 152 | mountOnEnter={mountOnEnter} |
| 153 | unmountOnExit={unmountOnExit} |
| 154 | > |
| 155 | <Nav |
| 156 | id={id} |
| 157 | {...controlledProps} |
| 158 | role="tablist" |
| 159 | as="ul" |
| 160 | variant={variant} |
| 161 | > |
| 162 | {map(children, renderTab)} |
| 163 | </Nav> |
| 164 | |
| 165 | <TabContent> |
| 166 | {map(children, (child) => { |
| 167 | const childProps = { ...child.props }; |
| 168 | |
| 169 | delete childProps.title; |
| 170 | delete childProps.disabled; |
| 171 | delete childProps.tabClassName; |
| 172 | delete childProps.tabAttrs; |
| 173 | |
| 174 | return <TabPane {...childProps} />; |
| 175 | })} |
| 176 | </TabContent> |
| 177 | </BaseTabs> |
| 178 | ); |
| 179 | }; |
| 180 | |
| 181 | Tabs.propTypes = propTypes; |
| 182 | Tabs.displayName = 'Tabs'; |
nothing calls this directly
no test coverage detected
searching dependent graphs…