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] Remove deprecated TreeView component #15093

Merged
merged 1 commit into from
Nov 7, 2024

Conversation

flaviendelangle
Copy link
Member

@flaviendelangle flaviendelangle commented Oct 24, 2024

Closes #14768

Changelog

Tree View

  • The <TreeView /> component has been renamed <SimpleTreeView /> which has exactly the same API:

    -import { TreeView } from '@mui/x-tree-view';
    +import { SimpleTreeView } from '@mui/x-tree-view';
    
    -import { TreeView } from '@mui/x-tree-view/TreeView';
    +import { SimpleTreeView } from '@mui/x-tree-view/SimpleTreeView';
    
       return (
    -    <TreeView>
    +    <SimpleTreeView>
           <TreeItem itemId="1" label="First item" />
    -    </TreeView>
    +    </SimpleTreeView>
       );

    If you were using theme augmentation, you will also need to migrate it:

     const theme = createTheme({
       components: {
    -    MuiTreeView: {
    +    MuiSimpleTreeView: {
           styleOverrides: {
             root: {
               opacity: 0.5,
             },
           },
         },
       },
     });

    If you were using the treeViewClasses object, you can replace it with the new simpleTreeViewClasses object:

     import { treeViewClasses } from '@mui/x-tree-view/TreeView';
     import { simpleTreeViewClasses } from '@mui/x-tree-view/SimpleTreeView';
    
    -const rootClass = treeViewClasses.root;
    +const rootClass = simpleTreeViewClasses.root;

@flaviendelangle flaviendelangle added breaking change component: tree view TreeView, TreeItem. This is the name of the generic UI component, not the React module! labels Oct 24, 2024
@flaviendelangle flaviendelangle self-assigned this Oct 24, 2024
@flaviendelangle flaviendelangle force-pushed the remove-tree-view branch 2 times, most recently from 2a78830 to 29acde0 Compare October 24, 2024 12:46
@@ -63,6 +63,54 @@ After running the codemods, make sure to test your application and that you don'
Feel free to [open an issue](https://github.com/mui/mui-x/issues/new/choose) for support if you need help to proceed with your migration.
:::

### ✅ Use Simple Tree View instead of Tree View
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copied from last year's migration guide

@flaviendelangle flaviendelangle marked this pull request as ready for review October 24, 2024 12:49
@mui-bot
Copy link

mui-bot commented Oct 24, 2024

Copy link
Contributor

@noraleonte noraleonte left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👌

@flaviendelangle flaviendelangle merged commit fc5bd87 into mui:master Nov 7, 2024
18 checks passed
@flaviendelangle flaviendelangle deleted the remove-tree-view branch November 7, 2024 09:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
breaking change component: tree view TreeView, TreeItem. This is the name of the generic UI component, not the React module!
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[TreeView] Remove the deprecated TreeView component in favor of SimpleTreeView
3 participants