Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[TreeView] Add "use client" directive to every public component and hook #14579

Merged
merged 3 commits into from
Sep 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
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