-
Notifications
You must be signed in to change notification settings - Fork 722
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
Create hooks for @vx/responsive #485
Comments
love this idea, noting that we have discussed re-implementing the current HOCs + would happily review a PR! |
Alright then! I'll create the PR with this hook, using this lib! Whenever I get to the point where I can show something, I'll post it here! Thanks! |
After working on it for a bit, I think it's not worth creating it here. What we could do is add documentation to use
The only thing that would change from our implementation to theirs, is the way we import it, that would probably be:
So what do you think of just adding this dependency to the docs? Another alternative would be to create our own, and it would work too. |
Re-thinking about it, I think we can change the implementation to something like:
and we can return the
And then we could simplify the usage in our case. This would simplify a lot the creation of responsive charts, as we won't need to pass the @williaster and @hshoff what do you guys think? |
Hey @pedroapfilho 👋 . In the latest suggestion, how would the That's an interesting thought. I do think sometimes users would want to be able to avoid rendering an additional |
What this provider would do is creating the The
|
Closing this as it looks like hooks were added in #1783 |
We already have the HOC (and thanks for that), but what if we make it as a hook? So we can use it as:
useScreenSize
.BTW, I can make the PR for that
The text was updated successfully, but these errors were encountered: