-
-
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
Cannot access props from VComp #819
Comments
Seems like some sort of a design deficiency. Shouldn't every node by definition have a way to retrieve its properties and its children? Even if those are unset. |
@jstarry any suggestions on how to resolve this? I am working on a material based component library and this is definitely a blocker for me. I want to fix this. I went through the html macro and understand how that works. The issue as I see it has to do with VNode not allowing for properties and children. There is a whole different approach for that with vcomp. If you give me some guidance on how this could be solved I will take a crack at it. The way I see things is that even the basic VNode should have children and properties. Even if they are ultimately just empty vec! |
Same here. It would be great if a component can access and manipulate it's children props. |
@MuhannadAlrusayni This can be done already. SNIPPET This issue was created because of an edge case situation. When
|
Fixed in #843 |
The only way to access props from a virtual component node is through the intermediary VChild node. This makes it impossible to access props of a child component which is a VNode type.
Proposed Solution
Add
get_properties
andget_properties_mut
methods to VComp and refactor away VChildThe text was updated successfully, but these errors were encountered: