-
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
new super-powerful API idea #70
Comments
This is great! I had a similar idea when I introduced it 😆 but I wasn't sure how I could make the API work. I need to explore some things further, but I love the start of this! I'd love to be able to handle multiple measurements in one pass if possible. I might start looking at a |
Sweet! Do you think it would cause any difficulties with attaching or detaching the resize observers? |
I don't think so! My initial idea for this was sparked by ResizeObservers being able to take multiple entries, so I just need to explore that a little more :) Essentially, I think you would have one ResizeObserver for the component and then each function call could subscribe to it. Then if the ref returns null it can unsubscribe. |
huh, I still don't know much about ResizeObservers. Anyway that's cool! |
Finally got around to this if you're interested in trying out the release candidate 😸 #97. |
Hi @souporserious,
The idea of passing a
measureRef
to the child function was genius, and it made me realize we could do something similar to make it possible for a single<Measure>
element to measure many components in one fell swoop.The idea is to turn
measureRef
into a function that we call with what to measure and the name of a state subtree, and then it returns a ref. So we can create as many refs as we need inside the child function:The other advantages of this API are:
The text was updated successfully, but these errors were encountered: