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

[withWidth] Add TypeScript definitions for options #14054

Merged
merged 2 commits into from
Jan 2, 2019

Conversation

anthotsang
Copy link
Contributor

@oliviertassinari
Copy link
Member

@anthotsang I think that we will deprecate this higher-order component, at some point, for the useMediaQuery hook. What do you think of this move?

@anthotsang
Copy link
Contributor Author

@oliviertassinari
I think I'd be happy to see a hook version once hooks are officially released. Although I would prefer to still keep withWidth HoC to not have to prematurely rewrite things using hooks when upgrading MUI versions.

React's general attitude towards hooks seems to be that it'll be better in the long term but it's best to keep support for HoCs to not break everyone's working code. I think the HoC could just be a wrapper on the hook if at some point it becomes difficult to keep maintaining both, just for backwards compatibility.

@oliviertassinari
Copy link
Member

@anthotsang The hook already exists https://material-ui.com/layout/use-media-query/. Ok, thanks for the feedback.

@oliviertassinari oliviertassinari merged commit 4930d9e into mui:master Jan 2, 2019
@oliviertassinari oliviertassinari changed the title [withWidth] Add typescript definitions for options. [withWidth] Add TypeScript definitions for options Jan 2, 2019
@oliviertassinari
Copy link
Member

@anthotsang 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.

2 participants