UNPKG

@atlaskit/side-navigation

Version:

A highly composable side navigation component that supports nested views.

13 lines • 610 B
import { useContext } from 'react'; import { NestedContext } from './nested-context'; export var useNestedContext = function useNestedContext() { var context = useContext(NestedContext); if (!context) { var error = ''; if (process.env.NODE_ENV === 'development') { error = "\nTo use a <NestingItem /> it needs to be a descendant of <NestableNavigationContent>.\nYou probably need to replace your <NavigationContent> with <NestableNavigationContent>.\n\nimport { NestableNavigationContent } from '@atlaskit/side-navigation';\n "; } throw new Error(error); } return context; };