Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
76 commits
Select commit Hold shift + click to select a range
0959bb5
[tree view] Introduce a Tree View Store to clean the internals
flaviendelangle Oct 22, 2025
10077fd
Work
flaviendelangle Oct 22, 2025
b4fe110
Work
flaviendelangle Oct 22, 2025
27fa4f7
Work
flaviendelangle Oct 22, 2025
8ed05d5
Work
flaviendelangle Oct 22, 2025
a1ba21e
Work
flaviendelangle Oct 22, 2025
0c5d862
Work
flaviendelangle Oct 23, 2025
7456cfe
Work
flaviendelangle Oct 23, 2025
c598543
Work
flaviendelangle Oct 23, 2025
fc7a7f2
Merge branch 'master' into tree-view-store
flaviendelangle Oct 24, 2025
55dc631
Work
flaviendelangle Oct 24, 2025
b8485c6
Work
flaviendelangle Oct 24, 2025
c7ea9d1
Work
flaviendelangle Oct 24, 2025
efa20ff
Work
flaviendelangle Oct 24, 2025
aeb8050
Work
flaviendelangle Oct 24, 2025
d4bef77
Work
flaviendelangle Oct 24, 2025
f35f8c1
Work
flaviendelangle Oct 24, 2025
5498c1d
Work
flaviendelangle Oct 24, 2025
97a2e0e
Regen doc
flaviendelangle Oct 24, 2025
7c55f38
Work
flaviendelangle Oct 24, 2025
557e40a
Work
flaviendelangle Oct 24, 2025
7b9242b
Work
flaviendelangle Oct 27, 2025
a16d6ab
Work
flaviendelangle Oct 27, 2025
6a71a84
Work
flaviendelangle Oct 27, 2025
a93c879
Work
flaviendelangle Oct 27, 2025
7c644e8
Merge branch 'master' into tree-view-store
flaviendelangle Oct 27, 2025
1e4ed2d
Work
flaviendelangle Oct 27, 2025
cbbffb6
Work
flaviendelangle Oct 27, 2025
9ddfa20
Work
flaviendelangle Oct 27, 2025
a07ceff
Work
flaviendelangle Oct 27, 2025
318a33e
Work
flaviendelangle Oct 28, 2025
9a1402e
Work
flaviendelangle Oct 28, 2025
63c5c4f
Work
flaviendelangle Oct 28, 2025
33cd77c
Work
flaviendelangle Oct 28, 2025
887d911
Work
flaviendelangle Oct 28, 2025
e443ff1
Work
flaviendelangle Oct 28, 2025
4388e18
Merge branch 'master' into tree-view-store
flaviendelangle Oct 28, 2025
a0e2a51
Work
flaviendelangle Oct 28, 2025
0d19e61
Merge branch 'master' into tree-view-store
flaviendelangle Oct 28, 2025
1660f49
Work
flaviendelangle Oct 28, 2025
1c5f69f
Work
flaviendelangle Oct 28, 2025
869ad32
Work
flaviendelangle Oct 28, 2025
6d14cac
Merge branch 'master' into tree-view-store
flaviendelangle Oct 29, 2025
f44734d
Work
flaviendelangle Oct 29, 2025
7ed6e59
Work
flaviendelangle Oct 29, 2025
822c425
Work
flaviendelangle Oct 29, 2025
4ac99d3
Merge
flaviendelangle Oct 29, 2025
17f3f96
Merge
flaviendelangle Oct 30, 2025
43ced84
Fix
flaviendelangle Oct 30, 2025
8816aa0
Merge branch 'master' into tree-view-store
flaviendelangle Oct 31, 2025
ac80fb3
Work
flaviendelangle Oct 31, 2025
e26ae32
Work
flaviendelangle Oct 31, 2025
26bcff6
Work
flaviendelangle Oct 31, 2025
3100ce7
Work
flaviendelangle Oct 31, 2025
dc27161
Merge branch 'master' into tree-view-store
flaviendelangle Oct 31, 2025
ec02b7d
Fix
flaviendelangle Oct 31, 2025
3eb3bfa
Fix
flaviendelangle Oct 31, 2025
850add1
Improve apiRef hooks
flaviendelangle Oct 31, 2025
90f37a4
Merge
flaviendelangle Nov 3, 2025
0e1ac48
Fix
flaviendelangle Nov 4, 2025
d3ee9fe
Work
flaviendelangle Nov 4, 2025
017ad53
Work
flaviendelangle Nov 5, 2025
9887252
Work
flaviendelangle Nov 5, 2025
bf884f4
Fix
flaviendelangle Nov 5, 2025
885f648
Merge
flaviendelangle Nov 6, 2025
67cb857
Work
flaviendelangle Nov 6, 2025
39cca29
Work
flaviendelangle Nov 6, 2025
2d75d91
Merge
flaviendelangle Nov 6, 2025
db4542a
[tree view] Expose one hook per component to initialize the apiRef
flaviendelangle Nov 6, 2025
1e64276
Fix
flaviendelangle Nov 6, 2025
4554fde
Fix
flaviendelangle Nov 6, 2025
072d700
Fix
flaviendelangle Nov 6, 2025
a72c35f
Merge
flaviendelangle Nov 6, 2025
4a909dd
Regen doc
flaviendelangle Nov 7, 2025
ab6eea8
Merge
flaviendelangle Nov 7, 2025
6de2ba2
Merge branch 'master' into tree-view-store
flaviendelangle Nov 10, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@ import Box from '@mui/material/Box';
import Stack from '@mui/material/Stack';
import Button from '@mui/material/Button';
import { RichTreeView } from '@mui/x-tree-view/RichTreeView';
import { useTreeViewApiRef } from '@mui/x-tree-view/hooks';
import { useRichTreeViewApiRef } from '@mui/x-tree-view/hooks';

export default function ApiMethodSetEditedItem() {
const [items, setItems] = React.useState([
{ id: '1', label: 'Jane Doe', editable: true },
]);
const apiRef = useTreeViewApiRef();
const apiRef = useRichTreeViewApiRef();

const handleAddFolder = () => {
const newId = String(items.length + 1);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@ import Box from '@mui/material/Box';
import Stack from '@mui/material/Stack';
import Button from '@mui/material/Button';
import { RichTreeView } from '@mui/x-tree-view/RichTreeView';
import { useTreeViewApiRef } from '@mui/x-tree-view/hooks';
import { useRichTreeViewApiRef } from '@mui/x-tree-view/hooks';

export default function ApiMethodSetEditedItem() {
const [items, setItems] = React.useState([
{ id: '1', label: 'Jane Doe', editable: true },
]);
const apiRef = useTreeViewApiRef();
const apiRef = useRichTreeViewApiRef();

const handleAddFolder = () => {
const newId = String(items.length + 1);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@ import Box from '@mui/material/Box';
import Stack from '@mui/material/Stack';
import Button from '@mui/material/Button';
import { RichTreeView } from '@mui/x-tree-view/RichTreeView';
import { useTreeViewApiRef } from '@mui/x-tree-view/hooks';
import { useRichTreeViewApiRef } from '@mui/x-tree-view/hooks';
import { MUI_X_PRODUCTS } from './products';

export default function ApiMethodUpdateItemLabel() {
const [isLabelUpdated, setIsLabelUpdated] = React.useState(false);
const apiRef = useTreeViewApiRef();
const apiRef = useRichTreeViewApiRef();

const handleUpdateLabel = () => {
if (isLabelUpdated) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@ import Box from '@mui/material/Box';
import Stack from '@mui/material/Stack';
import Button from '@mui/material/Button';
import { RichTreeView } from '@mui/x-tree-view/RichTreeView';
import { useTreeViewApiRef } from '@mui/x-tree-view/hooks';
import { useRichTreeViewApiRef } from '@mui/x-tree-view/hooks';
import { MUI_X_PRODUCTS } from './products';

export default function ApiMethodUpdateItemLabel() {
const [isLabelUpdated, setIsLabelUpdated] = React.useState(false);
const apiRef = useTreeViewApiRef();
const apiRef = useRichTreeViewApiRef();

const handleUpdateLabel = () => {
if (isLabelUpdated) {
Expand Down
4 changes: 2 additions & 2 deletions docs/data/tree-view/rich-tree-view/editing/EditLeaves.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import Box from '@mui/material/Box';
import { RichTreeView } from '@mui/x-tree-view/RichTreeView';
import { useTreeViewApiRef } from '@mui/x-tree-view/hooks';
import { useRichTreeViewApiRef } from '@mui/x-tree-view/hooks';

const MUI_X_PRODUCTS = [
{
Expand Down Expand Up @@ -36,7 +36,7 @@ const MUI_X_PRODUCTS = [
];

export default function EditLeaves() {
const apiRef = useTreeViewApiRef();
const apiRef = useRichTreeViewApiRef();
return (
<Box sx={{ minHeight: 352, minWidth: 260 }}>
<RichTreeView
Expand Down
4 changes: 2 additions & 2 deletions docs/data/tree-view/rich-tree-view/editing/EditLeaves.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import Box from '@mui/material/Box';
import { RichTreeView } from '@mui/x-tree-view/RichTreeView';
import { useTreeViewApiRef } from '@mui/x-tree-view/hooks';
import { useRichTreeViewApiRef } from '@mui/x-tree-view/hooks';
import { TreeViewBaseItem } from '@mui/x-tree-view/models';

type ExtendedTreeItemProps = {
Expand Down Expand Up @@ -43,7 +43,7 @@ const MUI_X_PRODUCTS: TreeViewBaseItem<ExtendedTreeItemProps>[] = [
];

export default function EditLeaves() {
const apiRef = useTreeViewApiRef();
const apiRef = useRichTreeViewApiRef();
return (
<Box sx={{ minHeight: 352, minWidth: 260 }}>
<RichTreeView
Expand Down
14 changes: 10 additions & 4 deletions docs/data/tree-view/rich-tree-view/editing/editing.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,15 +71,21 @@
## Imperative API

:::success
To use the `apiRef` object, you need to initialize it using the `useTreeViewApiRef` hook as follows:
To use the `apiRef` object, you need to initialize it using the `useRichTreeViewApiRef` or `useRichTreeViewProApiRef` hook as follows:

```tsx
const apiRef = useTreeViewApiRef();
// Community package
const apiRef = useRichTreeViewApiRef();

return <RichTreeView apiRef={apiRef} items={ITEMS}>;
return <RichTreeView apiRef={apiRef} items={ITEMS} />;

// Pro package
const apiRef = useRichTreeViewProApiRef();

return <RichTreeViewPro apiRef={apiRef} items={ITEMS} />;
```

When your component first renders, `apiRef` will be `undefined`.
When your component first renders, `apiRef.current` will be `undefined`.

Check warning on line 88 in docs/data/tree-view/rich-tree-view/editing/editing.md

View workflow job for this annotation

GitHub Actions / runner / vale

[vale] reported by reviewdog 🐶 [Google.Will] Avoid using 'will'. Raw Output: {"message": "[Google.Will] Avoid using 'will'.", "location": {"path": "docs/data/tree-view/rich-tree-view/editing/editing.md", "range": {"start": {"line": 88, "column": 53}}}, "severity": "WARNING"}
After this initial render, `apiRef` holds methods to interact imperatively with the Tree View.
:::

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import Button from '@mui/material/Button';
import Snackbar from '@mui/material/Snackbar';
import { RichTreeView } from '@mui/x-tree-view/RichTreeView';

import { useTreeViewApiRef } from '@mui/x-tree-view/hooks';
import { useRichTreeViewApiRef } from '@mui/x-tree-view/hooks';

const MUI_X_PRODUCTS = [
{
Expand Down Expand Up @@ -38,7 +38,7 @@ const MUI_X_PRODUCTS = [
];

export default function ApiMethodIsItemExpanded() {
const apiRef = useTreeViewApiRef();
const apiRef = useRichTreeViewApiRef();
const [isGridExpanded, setIsGridExpanded] = React.useState(false);
const [isSnackbarOpen, setIsSnackbarOpen] = React.useState(false);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import Button from '@mui/material/Button';
import Snackbar from '@mui/material/Snackbar';
import { RichTreeView } from '@mui/x-tree-view/RichTreeView';
import { TreeViewBaseItem } from '@mui/x-tree-view/models';
import { useTreeViewApiRef } from '@mui/x-tree-view/hooks';
import { useRichTreeViewApiRef } from '@mui/x-tree-view/hooks';

const MUI_X_PRODUCTS: TreeViewBaseItem[] = [
{
Expand Down Expand Up @@ -38,7 +38,7 @@ const MUI_X_PRODUCTS: TreeViewBaseItem[] = [
];

export default function ApiMethodIsItemExpanded() {
const apiRef = useTreeViewApiRef();
const apiRef = useRichTreeViewApiRef();
const [isGridExpanded, setIsGridExpanded] = React.useState<boolean>(false);
const [isSnackbarOpen, setIsSnackbarOpen] = React.useState(false);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import Stack from '@mui/material/Stack';
import Button from '@mui/material/Button';
import { RichTreeView } from '@mui/x-tree-view/RichTreeView';

import { useTreeViewApiRef } from '@mui/x-tree-view/hooks';
import { useRichTreeViewApiRef } from '@mui/x-tree-view/hooks';

const MUI_X_PRODUCTS = [
{
Expand Down Expand Up @@ -37,7 +37,7 @@ const MUI_X_PRODUCTS = [
];

export default function ApiMethodSetItemExpansion() {
const apiRef = useTreeViewApiRef();
const apiRef = useRichTreeViewApiRef();

const handleExpandClick = (event) => {
apiRef.current.setItemExpansion({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import Stack from '@mui/material/Stack';
import Button from '@mui/material/Button';
import { RichTreeView } from '@mui/x-tree-view/RichTreeView';
import { TreeViewBaseItem } from '@mui/x-tree-view/models';
import { useTreeViewApiRef } from '@mui/x-tree-view/hooks';
import { useRichTreeViewApiRef } from '@mui/x-tree-view/hooks';

const MUI_X_PRODUCTS: TreeViewBaseItem[] = [
{
Expand Down Expand Up @@ -37,7 +37,7 @@ const MUI_X_PRODUCTS: TreeViewBaseItem[] = [
];

export default function ApiMethodSetItemExpansion() {
const apiRef = useTreeViewApiRef();
const apiRef = useRichTreeViewApiRef();

const handleExpandClick = (event: React.MouseEvent) => {
apiRef.current!.setItemExpansion({
Expand Down
14 changes: 10 additions & 4 deletions docs/data/tree-view/rich-tree-view/expansion/expansion.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,15 +41,21 @@
## Imperative API

:::success
To use the `apiRef` object, you need to initialize it using the `useTreeViewApiRef` hook as follows:
To use the `apiRef` object, you need to initialize it using the `useRichTreeViewApiRef` or `useRichTreeViewProApiRef` hook as follows:

```tsx
const apiRef = useTreeViewApiRef();
// Community package
const apiRef = useRichTreeViewApiRef();

return <RichTreeView apiRef={apiRef} items={ITEMS}>;
return <RichTreeView apiRef={apiRef} items={ITEMS} />;

// Pro package
const apiRef = useRichTreeViewProApiRef();

return <RichTreeViewPro apiRef={apiRef} items={ITEMS} />;
```

When your component first renders, `apiRef` will be `undefined`.
When your component first renders, `apiRef.current` will be `undefined`.

Check warning on line 58 in docs/data/tree-view/rich-tree-view/expansion/expansion.md

View workflow job for this annotation

GitHub Actions / runner / vale

[vale] reported by reviewdog 🐶 [Google.Will] Avoid using 'will'. Raw Output: {"message": "[Google.Will] Avoid using 'will'.", "location": {"path": "docs/data/tree-view/rich-tree-view/expansion/expansion.md", "range": {"start": {"line": 58, "column": 53}}}, "severity": "WARNING"}
After this initial render, `apiRef` holds methods to interact imperatively with the Tree View.
:::

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import Stack from '@mui/material/Stack';
import Button from '@mui/material/Button';
import { RichTreeView } from '@mui/x-tree-view/RichTreeView';

import { useTreeViewApiRef } from '@mui/x-tree-view/hooks';
import { useRichTreeViewApiRef } from '@mui/x-tree-view/hooks';

const MUI_X_PRODUCTS = [
{
Expand Down Expand Up @@ -37,7 +37,7 @@ const MUI_X_PRODUCTS = [
];

export default function ApiMethodFocusItem() {
const apiRef = useTreeViewApiRef();
const apiRef = useRichTreeViewApiRef();
const handleButtonClick = (event) => {
apiRef.current?.focusItem(event, 'pickers');
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import Stack from '@mui/material/Stack';
import Button from '@mui/material/Button';
import { RichTreeView } from '@mui/x-tree-view/RichTreeView';
import { TreeViewBaseItem } from '@mui/x-tree-view/models';
import { useTreeViewApiRef } from '@mui/x-tree-view/hooks';
import { useRichTreeViewApiRef } from '@mui/x-tree-view/hooks';

const MUI_X_PRODUCTS: TreeViewBaseItem[] = [
{
Expand Down Expand Up @@ -37,7 +37,7 @@ const MUI_X_PRODUCTS: TreeViewBaseItem[] = [
];

export default function ApiMethodFocusItem() {
const apiRef = useTreeViewApiRef();
const apiRef = useRichTreeViewApiRef();
const handleButtonClick = (event: React.SyntheticEvent) => {
apiRef.current?.focusItem(event, 'pickers');
};
Expand Down
14 changes: 10 additions & 4 deletions docs/data/tree-view/rich-tree-view/focus/focus.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,21 @@
## Imperative API

:::success
To use the `apiRef` object, you need to initialize it using the `useTreeViewApiRef` hook as follows:
To use the `apiRef` object, you need to initialize it using the `useRichTreeViewApiRef` or `useRichTreeViewProApiRef` hook as follows:

```tsx
const apiRef = useTreeViewApiRef();
// Community package
const apiRef = useRichTreeViewApiRef();

return <RichTreeView apiRef={apiRef} items={ITEMS}>;
return <RichTreeView apiRef={apiRef} items={ITEMS} />;

// Pro package
const apiRef = useRichTreeViewProApiRef();

return <RichTreeViewPro apiRef={apiRef} items={ITEMS} />;
```

When your component first renders, `apiRef` will be `undefined`.
When your component first renders, `apiRef.current` will be `undefined`.

Check warning on line 30 in docs/data/tree-view/rich-tree-view/focus/focus.md

View workflow job for this annotation

GitHub Actions / runner / vale

[vale] reported by reviewdog 🐶 [Google.Will] Avoid using 'will'. Raw Output: {"message": "[Google.Will] Avoid using 'will'.", "location": {"path": "docs/data/tree-view/rich-tree-view/focus/focus.md", "range": {"start": {"line": 30, "column": 53}}}, "severity": "WARNING"}
After this initial render, `apiRef` holds methods to interact imperatively with the Tree View.
:::

Expand Down
4 changes: 2 additions & 2 deletions docs/data/tree-view/rich-tree-view/items/ApiMethodGetItem.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import Stack from '@mui/material/Stack';
import Typography from '@mui/material/Typography';
import { RichTreeView } from '@mui/x-tree-view/RichTreeView';

import { useTreeViewApiRef } from '@mui/x-tree-view/hooks';
import { useRichTreeViewApiRef } from '@mui/x-tree-view/hooks';

const MUI_X_PRODUCTS = [
{
Expand Down Expand Up @@ -37,7 +37,7 @@ const MUI_X_PRODUCTS = [
];

export default function ApiMethodGetItem() {
const apiRef = useTreeViewApiRef();
const apiRef = useRichTreeViewApiRef();
const [selectedItem, setSelectedItem] = React.useState(null);

const handleSelectedItemsChange = (event, itemId) => {
Expand Down
4 changes: 2 additions & 2 deletions docs/data/tree-view/rich-tree-view/items/ApiMethodGetItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import Stack from '@mui/material/Stack';
import Typography from '@mui/material/Typography';
import { RichTreeView } from '@mui/x-tree-view/RichTreeView';
import { TreeViewBaseItem } from '@mui/x-tree-view/models';
import { useTreeViewApiRef } from '@mui/x-tree-view/hooks';
import { useRichTreeViewApiRef } from '@mui/x-tree-view/hooks';

const MUI_X_PRODUCTS: TreeViewBaseItem[] = [
{
Expand Down Expand Up @@ -37,7 +37,7 @@ const MUI_X_PRODUCTS: TreeViewBaseItem[] = [
];

export default function ApiMethodGetItem() {
const apiRef = useTreeViewApiRef();
const apiRef = useRichTreeViewApiRef();
const [selectedItem, setSelectedItem] = React.useState<TreeViewBaseItem | null>(
null,
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import Stack from '@mui/material/Stack';
import Button from '@mui/material/Button';
import { RichTreeView } from '@mui/x-tree-view/RichTreeView';

import { useTreeViewApiRef } from '@mui/x-tree-view/hooks';
import { useRichTreeViewApiRef } from '@mui/x-tree-view/hooks';

const MUI_X_PRODUCTS = [
{
Expand Down Expand Up @@ -37,7 +37,7 @@ const MUI_X_PRODUCTS = [
];

export default function ApiMethodGetItemDOMElement() {
const apiRef = useTreeViewApiRef();
const apiRef = useRichTreeViewApiRef();
const handleScrollToChartsCommunity = (event) => {
apiRef.current.focusItem(event, 'charts-community');
apiRef.current
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import Stack from '@mui/material/Stack';
import Button from '@mui/material/Button';
import { RichTreeView } from '@mui/x-tree-view/RichTreeView';
import { TreeViewBaseItem } from '@mui/x-tree-view/models';
import { useTreeViewApiRef } from '@mui/x-tree-view/hooks';
import { useRichTreeViewApiRef } from '@mui/x-tree-view/hooks';

const MUI_X_PRODUCTS: TreeViewBaseItem[] = [
{
Expand Down Expand Up @@ -37,7 +37,7 @@ const MUI_X_PRODUCTS: TreeViewBaseItem[] = [
];

export default function ApiMethodGetItemDOMElement() {
const apiRef = useTreeViewApiRef();
const apiRef = useRichTreeViewApiRef();
const handleScrollToChartsCommunity = (event: React.SyntheticEvent) => {
apiRef.current!.focusItem(event, 'charts-community');
apiRef
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import Stack from '@mui/material/Stack';
import Typography from '@mui/material/Typography';
import { RichTreeView } from '@mui/x-tree-view/RichTreeView';

import { useTreeViewApiRef } from '@mui/x-tree-view/hooks';
import { useRichTreeViewApiRef } from '@mui/x-tree-view/hooks';

const MUI_X_PRODUCTS = [
{
Expand Down Expand Up @@ -37,7 +37,7 @@ const MUI_X_PRODUCTS = [
];

export default function ApiMethodGetItemOrderedChildrenIds() {
const apiRef = useTreeViewApiRef();
const apiRef = useRichTreeViewApiRef();
const [isSelectedItemLeaf, setIsSelectedItemLeaf] = React.useState(null);

const handleSelectedItemsChange = (event, itemId) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import Stack from '@mui/material/Stack';
import Typography from '@mui/material/Typography';
import { RichTreeView } from '@mui/x-tree-view/RichTreeView';
import { TreeViewBaseItem } from '@mui/x-tree-view/models';
import { useTreeViewApiRef } from '@mui/x-tree-view/hooks';
import { useRichTreeViewApiRef } from '@mui/x-tree-view/hooks';

const MUI_X_PRODUCTS: TreeViewBaseItem[] = [
{
Expand Down Expand Up @@ -37,7 +37,7 @@ const MUI_X_PRODUCTS: TreeViewBaseItem[] = [
];

export default function ApiMethodGetItemOrderedChildrenIds() {
const apiRef = useTreeViewApiRef();
const apiRef = useRichTreeViewApiRef();
const [isSelectedItemLeaf, setIsSelectedItemLeaf] = React.useState<boolean | null>(
null,
);
Expand Down
Loading
Loading