UNPKG

@mui/x-tree-view

Version:

The community edition of the MUI X Tree View components.

38 lines (37 loc) 1.21 kB
'use client'; import * as React from 'react'; import PropTypes from 'prop-types'; import { useStore } from '@mui/x-internals/store'; import { useTreeViewContext } from "../internals/TreeViewProvider/index.js"; import { idSelectors } from "../internals/plugins/id/index.js"; import { jsx as _jsx } from "react/jsx-runtime"; function TreeItemProvider(props) { const { children, itemId, id } = props; const { wrapItem, store } = useTreeViewContext(); const idAttribute = useStore(store, idSelectors.treeItemIdAttribute, itemId, id); return /*#__PURE__*/_jsx(React.Fragment, { children: wrapItem({ children, itemId, store, idAttribute }) }); } process.env.NODE_ENV !== "production" ? TreeItemProvider.propTypes = { // ----------------------------- Warning -------------------------------- // | These PropTypes are generated from the TypeScript type definitions | // | To update them edit the TypeScript types and run "pnpm proptypes" | // ---------------------------------------------------------------------- children: PropTypes.node, id: PropTypes.string, itemId: PropTypes.string.isRequired } : void 0; export { TreeItemProvider };