Skip to content

[withMobileDialog] Remove HOC#23202

Merged
oliviertassinari merged 1 commit into
mui:nextfrom
RDIL:next
Oct 22, 2020
Merged

[withMobileDialog] Remove HOC#23202
oliviertassinari merged 1 commit into
mui:nextfrom
RDIL:next

Conversation

@RDIL

@RDIL RDIL commented Oct 22, 2020

Copy link
Copy Markdown
Contributor

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 [email protected]

Removes the withMobileDialog component from the source.

See #14992, #20012

Signed-off-by: Reece Dunham <[email protected]>
@mui-pr-bot

mui-pr-bot commented Oct 22, 2020

Copy link
Copy Markdown

Details of bundle changes

Generated by 🚫 dangerJS against 53b653f

@oliviertassinari oliviertassinari added the breaking change Introduces changes that are not backward compatible. label Oct 22, 2020
@oliviertassinari oliviertassinari added this to the v5 milestone Oct 22, 2020
@oliviertassinari

Copy link
Copy Markdown
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

RDIL commented Oct 22, 2020

Copy link
Copy Markdown
Contributor Author

@oliviertassinari which file is that?

@oliviertassinari

Copy link
Copy Markdown
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

oliviertassinari commented Oct 22, 2020

Copy link
Copy Markdown
Member

@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
Copy Markdown
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

RDIL commented Nov 14, 2020

Copy link
Copy Markdown
Contributor Author

I can do this on monday, sure

@mbrookes

Copy link
Copy Markdown
Member

@RDIL Much appreciated, thank you!

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

Labels

breaking change Introduces changes that are not backward compatible.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants