@atlaskit/tabs
Version:
Tabs are used to organize content by grouping similar information on the same page.
14 lines (13 loc) • 431 B
JavaScript
import { useContext } from 'react';
import { TabPanelContext } from './internal/tab-panel-context';
// TODO: Fill in the hook {description}.
/**
* {description}.
*/
export default function useTabPanel() {
const tabPanelData = useContext(TabPanelContext);
if (tabPanelData === null || typeof tabPanelData === 'undefined') {
throw Error('@atlaskit/tabs: A TabPanel must have a Tabs parent.');
}
return tabPanelData;
}