@atlaskit/side-navigation
Version:
A highly composable side navigation component that supports nested views.
19 lines (18 loc) • 767 B
JavaScript
;
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.useNestedContext = void 0;
var _react = require("react");
var _nestedContext = require("./nested-context");
var useNestedContext = exports.useNestedContext = function useNestedContext() {
var context = (0, _react.useContext)(_nestedContext.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;
};