Skip to content

Commit

Permalink
[material-ui][docs] Migrating from deprecated apis follow up (#40981)
Browse files Browse the repository at this point in the history
  • Loading branch information
DiegoAndai authored Feb 7, 2024
1 parent 2321cf6 commit bc5b480
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ Material UI provides the `deprecations/all` codemod to help you stay up to date
npx @mui/codemod@latest deprecations/all <path>
```

This command runs all the current [deprecations codemods](/~https://github.com/mui/material-ui/tree/master/packages/mui-codemod#deprecations), automatically migrating to the updated API.
This command runs all the current [deprecations codemods](/~https://github.com/mui/material-ui/tree/HEAD/packages/mui-codemod#deprecations), automatically migrating to the updated API.
You can run this codemod as often as necessary to keep up with the latest changes.

:::info
Expand All @@ -30,22 +30,22 @@ If you need to run a specific codemod, those are also linked below.

### TransitionComponent

The Accordion's `TransitionComponent` was deprecated in favor of `slots.transition` ([Codemod](/~https://github.com/mui/material-ui/tree/master/packages/mui-codemod#accordion-props)):
The Accordion's `TransitionComponent` was deprecated in favor of `slots.transition` ([Codemod](/~https://github.com/mui/material-ui/tree/HEAD/packages/mui-codemod#accordion-props)):

```diff
<Accordion
- TransitionComponent={CustomTransition}
+ slots={{ transition: CustomTransition }}
- TransitionComponent={CustomTransition}
+ slots={{ transition: CustomTransition }}
/>
```

### TransitionProps

The Accordion's `TransitionProps` was deprecated in favor of `slotProps.transition` ([Codemod](/~https://github.com/mui/material-ui/tree/master/packages/mui-codemod#accordion-props)):
The Accordion's `TransitionProps` was deprecated in favor of `slotProps.transition` ([Codemod](/~https://github.com/mui/material-ui/tree/HEAD/packages/mui-codemod#accordion-props)):

```diff
<Accordion
- TransitionProps={{ unmountOnExit: true }}
+ slotProps={{ transition: { unmountOnExit: true } }}
- TransitionProps={{ unmountOnExit: true }}
+ slotProps={{ transition: { unmountOnExit: true } }}
/>
```
8 changes: 4 additions & 4 deletions packages/mui-codemod/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,10 +80,10 @@ A combination of all deprecations.

```diff
<Accordion
- TransitionComponent={CustomTransition}
- TransitionProps={{ unmountOnExit: true }}
+ slots={{ transition: CustomTransition }}
+ slotProps={{ transition: { unmountOnExit: true } }}
- TransitionComponent={CustomTransition}
- TransitionProps={{ unmountOnExit: true }}
+ slots={{ transition: CustomTransition }}
+ slotProps={{ transition: { unmountOnExit: true } }}
/>
```

Expand Down

0 comments on commit bc5b480

Please sign in to comment.