How to dynamically add child components to parent. #2400
Replies: 4 comments 4 replies
-
|
Beta Was this translation helpful? Give feedback.
-
Thanks for your response! I've tried extending the example but I am having trouble with these parts:
Please see my code below:
|
Beta Was this translation helpful? Give feedback.
-
@voidpumpkin Thanks again for your help! I think I've almost got it, is this a valid approach? One issue I'm having is globally updating all the values of the child components, through the logging I can see the values change, but what is rendered doesn't seem to update. main.rs:
Cargo.toml:
|
Beta Was this translation helpful? Give feedback.
-
I don't understand the usage of for here |
Beta Was this translation helpful? Give feedback.
-
Hello!
I'm new to front-end development, so this might be an obvious question - but I can't seem to wrap my head around how I would dynamically add a child component to a parent. It wasn't clear to me in the docs on how to do this - or if I even should.
Can I use a button click in the parent to send a message, then use the update function to create and then add a child component?
If anyone could point me in the right direction it would be much appreciated!
Beta Was this translation helpful? Give feedback.
All reactions