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

[withMobileDialog] Remove HOC #23202

Merged
merged 1 commit into from
Oct 22, 2020
Merged

[withMobileDialog] Remove HOC #23202

merged 1 commit into from
Oct 22, 2020

Conversation

RDIL
Copy link
Contributor

@RDIL RDIL commented Oct 22, 2020

Breaking changes

  • [withMobileDialog] Remove this higher-order component. The hook API allows a simpler and more flexible solution:
-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;

Signed-off-by: Reece Dunham me@rdil.rocks

Removes the withMobileDialog component from the source.

See #14992, #20012

Signed-off-by: Reece Dunham <me@rdil.rocks>
@mui-pr-bot
Copy link

mui-pr-bot commented Oct 22, 2020

Details of bundle changes

Generated by 🚫 dangerJS against 53b653f

@oliviertassinari
Copy link
Member

@RDIL Thanks for the pull request!

Could you update the migration guide to v5 with the updated section of the pull request's description? I have tried to push it but I was rejected:

ERROR: Permission to ourforks/material-ui.git denied to oliviertassinari.

@RDIL
Copy link
Contributor Author

RDIL commented Oct 22, 2020

@oliviertassinari which file is that?

@oliviertassinari
Copy link
Member

@RDIL I will do a commit directly on the next branch, simpler.

@oliviertassinari oliviertassinari changed the title [withMobileDialog] Remove from source [withMobileDialog] Remove HOC Oct 22, 2020
@oliviertassinari oliviertassinari merged commit b6e2308 into mui:next Oct 22, 2020
@oliviertassinari
Copy link
Member

oliviertassinari commented Oct 22, 2020

@RDIL Thanks, do you think that you could add on a deprecation message on v4 (master branch) too? This is important for #22074 :).

@mbrookes
Copy link
Member

Hey @RDIL! 👋 Do you think you might be able to add a deprecation warning for this on the master branch?

You can probably find a suitable example to follow in #20012 Deprecations section – PR # prefixed with "Dep:".

Thanks!

@RDIL
Copy link
Contributor Author

RDIL commented Nov 14, 2020

I can do this on monday, sure

@mbrookes
Copy link
Member

@RDIL Much appreciated, thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants