Skip to main content

Dynamic number of nested component instances

  • January 10, 2023
  • 1 reply
  • 1769 views

Erin_HG

Similar to how {children} works in a React component, it would be nice to be able to add/remove additional instances of nested components. Think adding/removing fills on a an element, but for nested components. This could remove the need to create an arbitrary set of child components that equals the max known number of children and having to show/hide the extras depending on how many are needed.

An example:

I have a “Dropdown” component that could have any number of list items. The main component needs to have the max number of possible list items included as individual child components. Which creates a lot of repetitive noise in instance when in use:

If I could add-remove nested components, then the sidebar might look something like this instead:

This topic has been closed for comments

1 reply

  • 0 replies
  • April 10, 2023

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings