-
-
Notifications
You must be signed in to change notification settings - Fork 4.4k
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
bind:width bind:height #984
Comments
Update: ignore this. No problem at all. |
Implemented in 2.4.0. Has a couple of caveats: it doesn't work with void elements or children of SVGs, and |
So apparently I'm not the only one who does this sort of thing:
https://twitter.com/shancarter/status/938185099140415493
It's very useful, particularly in the context of dataviz, to be able to get the dimensions of an element. I'll often have something like this:
It's annoying boilerplate, especially if you have several of these. You could create a helper component — example 1, example 2 allowing percentage heights — but that's annoying too.
A really nice solution might be to add
width
andheight
element bindings:No more boilerplate. In particular we don't have the annoyance of having to add an
oncreate
handler just to call a method.Under the hood this could use this fiendishly clever solution (used in react-resize-detector, giving way to ResizeObserver when it's ready.
The text was updated successfully, but these errors were encountered: