-
Notifications
You must be signed in to change notification settings - Fork 109
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
more convenient API #11
Comments
I actually had this in the very first release https://github.com/souporserious/react-measure/tree/0.0.8 but I needed the ability to |
We could certainly support both, right? For instance if |
Plus I think the ability to specify any random DOM property or computedStyle attribute one wants to read is nice and would fit into with the premise of this library well |
Oh, cool! Thanks! |
Inspired by the API of react-motion, I came up with this component today, before finding this repo. What do you think? It allows you to measure any DOM property or computedStyle attribute, and passes them to a child callback function that you use to render instead of having to
setState
. Obviously it doesn't use mutation observers but that could be integrated into this approach. What do you think? If you like it I could work on turning this into a PR for a new major version.Using it looks like this:
And here's the component:
The text was updated successfully, but these errors were encountered: