Skip to content

Commit

Permalink
[docs] Improve migration v5 guide
Browse files Browse the repository at this point in the history
  • Loading branch information
oliviertassinari committed Oct 22, 2020
1 parent b6e2308 commit 6a8ddb0
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions docs/src/pages/guides/migration-v4/migration-v4.md
Original file line number Diff line number Diff line change
Expand Up @@ -372,6 +372,24 @@ const classes = makeStyles(theme => ({
/>
```

- [withMobileDialog] Remove this higher-order component. The hook API allows a simpler and more flexible solution:

```diff
-import withMobileDialog from '@material-ui/core/withMobileDialog';
+import { useTheme, useMediaQuery } from '@material-ui/core';

function ResponsiveDialog(props) {
- const { fullScreen } = props;
+ const theme = useTheme();
+ const fullScreen = useMediaQuery(theme.breakpoints.down('sm'));
const [open, setOpen] = React.useState(false);

// ...

-export default withMobileDialog()(ResponsiveDialog);
+export default ResponsiveDialog;
```

### Divider

- Use border instead of background color. It prevents inconsistent height on scaled screens. For people customizing the color of the border, the change requires changing the override CSS property:
Expand Down

0 comments on commit 6a8ddb0

Please sign in to comment.