"use strict";

var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.useTreeViewContext = void 0;
var React = _interopRequireWildcard(require("react"));
var _TreeViewContext = require("./TreeViewContext");
const useTreeViewContext = () => {
  const context = React.useContext(_TreeViewContext.TreeViewContext);
  if (context == null) {
    throw new Error(['MUI X: Could not find the Tree View context.', 'It looks like you rendered your component outside of a SimpleTreeView or RichTreeView parent component.', 'This can also happen if you are bundling multiple versions of the Tree View.'].join('\n'));
  }
  return context;
};
exports.useTreeViewContext = useTreeViewContext;