E
E
E2015-12-08 14:17:01
React
E, 2015-12-08 14:17:01

How to implement dynamic adding/removing a component?

There is a component (child), just a markup with several fields, and there is a parent component that has an "Add more fields" button, it is necessary that when the button is clicked on the page, a child component is added, that is, with each click, the child component is added so many times, how many times we click on the "Add more fields" button. Perhaps there is a more elegant way, but I think that in my case I need to add a child component to the page several times, because everything is the same there.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
N
Nikita Gushchin, 2015-12-08
@aylo

How to add an element to a form on click in React?
Example - jsfiddle.net/yuvuyrhv/19

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question