MCPcopy
hub / github.com/react-bootstrap/react-bootstrap / Tabs

Function Tabs

src/Tabs.tsx:131–179  ·  view source on GitHub ↗
(props)

Source from the content-addressed store, hash-verified

129}
130
131const 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
181Tabs.propTypes = propTypes;
182Tabs.displayName = 'Tabs';

Callers

nothing calls this directly

Calls 3

mapFunction · 0.90
getDefaultActiveKeyFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…