@@ -47,18 +47,16 @@ const TabsContext = createContext<{
4747 type : TabType ;
4848 activeTabRef ?: Ref < HTMLAnchorElement > ;
4949 tabIdPrefix ?: string ;
50- tabItemIdPrefix ?: string ;
5150} > ( { type : 'default' } ) ;
5251
5352/**
5453 * Custom hook to generate unique tab IDs
5554 */
5655const useTabIds = ( eventKey ?: TabKey ) => {
57- const { tabIdPrefix, tabItemIdPrefix } = useContext ( TabsContext ) ;
56+ const { tabIdPrefix } = useContext ( TabsContext ) ;
5857 const tabIndex = eventKey ? String ( eventKey ) : '0' ;
5958 const tabId = `${ tabIdPrefix } -${ tabIndex } ` ;
60- const tabItemId = `${ tabItemIdPrefix } -${ tabIndex } ` ;
61- return { tabId, tabItemId } ;
59+ return { tabId } ;
6260} ;
6361
6462/**
@@ -158,7 +156,7 @@ const TabItem = <RendererProps extends TabItemRendererProps>(
158156 const { type, activeTabRef } = useContext ( TabsContext ) ;
159157 const activeKey = useContext ( TabsActiveKeyContext ) ;
160158 const { onTabClick, onTabKeyDown } = useContext ( TabsHandlersContext ) ;
161- const { tabId, tabItemId } = useTabIds ( eventKey ) ;
159+ const { tabId } = useTabIds ( eventKey ) ;
162160 let { menuItems } = props ;
163161 menuItems = menu
164162 ? React . Children . toArray (
@@ -197,7 +195,6 @@ const TabItem = <RendererProps extends TabItemRendererProps>(
197195 } `}
198196 >
199197 < a
200- id = { tabItemId }
201198 className = { tabLinkClassName }
202199 role = 'tab'
203200 ref = { isActive ? activeTabRef : undefined }
@@ -262,13 +259,12 @@ export const Tab = <
262259) => {
263260 const { className, eventKey, children } = props ;
264261 const activeKey = useContext ( TabsActiveKeyContext ) ;
265- const { tabId, tabItemId } = useTabIds ( eventKey ) ;
262+ const { tabId } = useTabIds ( eventKey ) ;
266263 return (
267264 < TabContent
268265 id = { tabId }
269266 className = { className }
270267 active = { eventKey != null && eventKey === activeKey }
271- aria-labelledby = { tabItemId }
272268 >
273269 { children }
274270 </ TabContent >
0 commit comments