import * as React from 'react';
import { TreeViewContext } from "./TreeViewContext.js";
export const useTreeViewContext = () => {
  const context = React.useContext(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;
};