Skip to content

Commit

Permalink
[TreeView] Add "use client" directive to every public component and…
Browse files Browse the repository at this point in the history
… hook (#14579)
  • Loading branch information
flaviendelangle authored Sep 17, 2024
1 parent c93f76b commit eee1c24
Show file tree
Hide file tree
Showing 9 changed files with 18 additions and 0 deletions.
10 changes: 10 additions & 0 deletions packages/rsc-builder/buildRsc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ type Project = {
ignorePaths?: string[];
};

// The data grid packages are not using this script.
// Instead, they are manually adding the "use client" directive in the entry point of each package.
const PROJECTS: Project[] = [
{
name: 'x-date-pickers',
Expand All @@ -31,6 +33,14 @@ const PROJECTS: Project[] = [
name: 'x-charts-pro',
rootPath: path.join(process.cwd(), 'packages/x-charts-pro'),
},
{
name: 'x-tree-view',
rootPath: path.join(process.cwd(), 'packages/x-tree-view'),
},
{
name: 'x-tree-view-pro',
rootPath: path.join(process.cwd(), 'packages/x-tree-view-pro'),
},
];

async function processFile(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
'use client';
import * as React from 'react';
import PropTypes from 'prop-types';
import composeClasses from '@mui/utils/composeClasses';
Expand Down
1 change: 1 addition & 0 deletions packages/x-tree-view/src/RichTreeView/RichTreeView.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
'use client';
import * as React from 'react';
import PropTypes from 'prop-types';
import composeClasses from '@mui/utils/composeClasses';
Expand Down
1 change: 1 addition & 0 deletions packages/x-tree-view/src/SimpleTreeView/SimpleTreeView.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
'use client';
import * as React from 'react';
import PropTypes from 'prop-types';
import composeClasses from '@mui/utils/composeClasses';
Expand Down
1 change: 1 addition & 0 deletions packages/x-tree-view/src/TreeItem/TreeItem.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
'use client';
import * as React from 'react';
import PropTypes from 'prop-types';
import clsx from 'clsx';
Expand Down
1 change: 1 addition & 0 deletions packages/x-tree-view/src/TreeItem/useTreeItemState.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
'use client';
import * as React from 'react';
import { MuiCancellableEvent } from '../internals/models/MuiCancellableEvent';
import { useTreeViewContext } from '../internals/TreeViewProvider';
Expand Down
1 change: 1 addition & 0 deletions packages/x-tree-view/src/TreeItem2/TreeItem2.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
'use client';
import * as React from 'react';
import PropTypes from 'prop-types';
import clsx from 'clsx';
Expand Down
1 change: 1 addition & 0 deletions packages/x-tree-view/src/TreeView/TreeView.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
'use client';
import * as React from 'react';
import PropTypes from 'prop-types';
import composeClasses from '@mui/utils/composeClasses';
Expand Down
1 change: 1 addition & 0 deletions packages/x-tree-view/src/hooks/useTreeViewApiRef.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
'use client';
import * as React from 'react';
import { TreeViewAnyPluginSignature, TreeViewPublicAPI } from '../internals/models';
import { RichTreeViewPluginSignatures } from '../RichTreeView/RichTreeView.plugins';
Expand Down

0 comments on commit eee1c24

Please sign in to comment.