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] Provide a hook API #13600

Closed
Kizmar opened this issue Nov 14, 2018 · 10 comments
Closed

[withWidth] Provide a hook API #13600

Kizmar opened this issue Nov 14, 2018 · 10 comments
Labels
good first issue Great for first contributions. Enable to learn the contribution process. new feature New feature or request priority: important This change can make a difference
Milestone

Comments

@Kizmar
Copy link

Kizmar commented Nov 14, 2018

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.

@oliviertassinari oliviertassinari added the new feature New feature or request label Nov 14, 2018
@oliviertassinari oliviertassinari modified the milestones: v3.5.0, v4 Nov 14, 2018
@oliviertassinari oliviertassinari changed the title Hidden section documentation request/update [withWidth] Provide a hook API Nov 14, 2018
@oliviertassinari
Copy link
Member

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

@oliviertassinari oliviertassinari added good first issue Great for first contributions. Enable to learn the contribution process. priority: important This change can make a difference labels Nov 14, 2018
@IssueHuntBot
Copy link

@issuehuntfest has funded $40.00 to this issue. See it on IssueHunt

@joshwooding
Copy link
Member

@oliviertassinari what package would unstable_useWidth be in? I'm unsure where to get the theme breakpoints from

@oliviertassinari
Copy link
Member

@joshwooding The @material-ui/core package sounds like a nice target. As long as it's labeled unstable, people can expect breaking changes.

@joshwooding
Copy link
Member

@oliviertassinari How would you get the breakpoints from the theme with the old context?

@oliviertassinari
Copy link
Member

@joshwooding Using @material-ui/styles/ThemeProvider.

@joshwooding
Copy link
Member

@oliviertassinari Is it okay to add that dependency across packages?

@oliviertassinari
Copy link
Member

We will kill the @material-ui/core/styles module with v4 for @material-ui/styles. We can add the package as a dependency.

@IssueHuntBot
Copy link

@joshwooding has submitted a pull request. See it on IssueHunt

@IssueHuntBot
Copy link

@oliviertassinari has rewarded $36.00 to @joshwooding. See it on IssueHunt

  • 💰 Total deposit: $40.00
  • 🎉 Repository reward(0%): $0.00
  • 🔧 Service fee(10%): $4.00

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Great for first contributions. Enable to learn the contribution process. new feature New feature or request priority: important This change can make a difference
Projects
None yet
Development

No branches or pull requests

4 participants