Regarding the Hidden documentation about breakpoints, specifically this code example:
Would it be possible to get a version of this code example using React Hooks instead of recompose/compose? Recompose is being deprecated (basically) with the addition of hooks.
@Kizmar Hooks aren't stable yet, they are implemented on an alpha version of React. I think that we can expose a hook API version of our withWidth HOC with an explicit unstable_ prefix.
@issuehuntfest has funded $40.00 to this issue. See it on IssueHunt
@oliviertassinari what package would unstable_useWidth be in? I'm unsure where to get the theme breakpoints from
@joshwooding The @material-ui/core package sounds like a nice target. As long as it's labeled unstable, people can expect breaking changes.
@oliviertassinari How would you get the breakpoints from the theme with the old context?
@joshwooding Using @material-ui/styles/ThemeProvider.
@oliviertassinari Is it okay to add that dependency across packages?
We will kill the @material-ui/core/styles module with v4 for @material-ui/styles. We can add the package as a dependency.
@joshwooding has submitted a pull request. See it on IssueHunt
@oliviertassinari has rewarded $36.00 to @joshwooding. See it on IssueHunt
Most helpful comment
@Kizmar Hooks aren't stable yet, they are implemented on an alpha version of React. I think that we can expose a hook API version of our withWidth HOC with an explicit
unstable_prefix.