-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[docs] Add migration guide for the Tree View (#9987)
- Loading branch information
1 parent
a0024a6
commit b4d7611
Showing
4 changed files
with
65 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
53 changes: 53 additions & 0 deletions
53
docs/data/migration/migration-tree-view-lab/migration-tree-view-lab.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
--- | ||
productId: x-tree-view | ||
--- | ||
|
||
# Migration from the lab | ||
|
||
<p class="description">MUI Tree View is now available on MUI X!</p> | ||
|
||
## Introduction | ||
|
||
This is a reference for migrating your site's tree view from `@mui/lab` to `@mui/x-tree-view`. | ||
This migration is about the npm packages used, it **does not** affect the behavior of the components in your application. | ||
|
||
[//]: # 'You can find why we are moving in this direction in the [announcement blog post](/blog/lab-tree-view-to-mui-x/).' | ||
|
||
## Migration steps | ||
|
||
### 1. Install MUI X package | ||
|
||
<codeblock storageKey="package-manager"> | ||
```bash npm | ||
npm install @mui/x-tree-view | ||
``` | ||
|
||
```bash yarn | ||
yarn add @mui/x-tree-view | ||
``` | ||
|
||
```bash pnpm | ||
pnpm add @mui/x-tree-view | ||
``` | ||
|
||
</codeblock> | ||
|
||
### 2. Run the code mod | ||
|
||
We have prepared a codemod to help you migrate your codebase. | ||
|
||
You can either run it on a specific file, folder, or your entire codebase when choosing the `<path>` argument. | ||
|
||
```bash | ||
npx @mui/codemod v5.0.0/tree-view-moved-to-x <path> | ||
``` | ||
|
||
Which will transform the imports like this: | ||
|
||
```diff | ||
-import TreeView from '@mui/lab/TreeView'; | ||
+import { TreeView } from '@mui/x-tree-view/TreeView'; | ||
|
||
-import { TreeView, TreeItem } from '@mui/lab'; | ||
+import { TreeView, TreeItem } from '@mui/x-tree-view'; | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
import * as React from 'react'; | ||
import MarkdownDocs from 'docs/src/modules/components/MarkdownDocs'; | ||
import * as pageProps from 'docsx/data/migration/migration-tree-view-lab/migration-tree-view-lab.md?@mui/markdown'; | ||
|
||
export default function Page() { | ||
return <MarkdownDocs {...pageProps} />; | ||
} |