-
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
How to use ref
on custom element?
#113
Comments
You need to pass
|
I probably didn't explain this well enough, but what I wanted to say was: So my question is how to use So there's no way for me to pass an |
I guess if the library you're using does not provide a way of passing a ref to then rendered element, then you're out of luck :/ But maybe I'm wrong and there is some (maybe hacky) way of accessing the ref? |
Well yes, there is, I'm currently using |
You can just wrap the custom element with a <Measure ...>
{({measureRef}) => <div ref={measureRef}><Card ...> ... </Card></div>}
</Measure> |
First, sorry for using the issue tracker for a question, but I didn't see any mention of a mailing list or forum!
So my question is how to use
<Measure>
with a custom element, like for example a semantic-ui control? I'm trying to do this:but that results in "TypeError: Failed to execute 'observe' on 'ResizeObserver': parameter 1 is not of type 'Element'".
I can add a
<div>
around it and put the ref on that but that results in the bounds not being exactly correct (they tend to be quite a bit bigger than the actual element I'm trying to measure).Any ideas?
The text was updated successfully, but these errors were encountered: