-
-
Notifications
You must be signed in to change notification settings - Fork 1.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
Add parent parameter to Component's mounted function #616
Comments
Something like |
@hgzimmerman @Wodann would refs solve this issue? We could potentially enforce those at compile time |
I don't have a full comprehension of how refs work in this context, but if you think an alternative approach instead of my quick and dirty solution can more accurately constrain possible misuses of the API, or ultimately offer something simpler to use, please favor that instead. |
A For me, the question is whether we could ever have a parent that is not an |
@Wodann @hgzimmerman this is what I had in mind: #665 |
@jstarry That seems like an efficient solution 👍 |
Closing in favour of refs approach |
I'm submitting a feature request for the addition of a
parent: &Element
- that implements theIParentNode
trait - to thefn mounted(&self)
of aComponent
:fn mounted(&self, parent: &Element)
Instead of having to look through the entire document tree to find the current element, we'd be able to use the parent node to execute any desired JS, resulting in a significant speed up.
The text was updated successfully, but these errors were encountered: