2021年1月25日星期一

how to render a same component one or multiple time using event handler

I want to build form in Which there are some text fields as shown in picture

Form

in this form there is a button and after clicking the Add Units button a new form will appear enter image description here

how can i render this sub form by using button onClick Event-Handler and i also want to render it as many times as i click the button , if i click button one time then it shows the the sub form only one time if i click the button two times then it will show two times

-The main issue is I want the sub form to appear as many time i click the button

(optional if i want to remove the rendered sub form using a button click then please mention the code )

use of react hooks is preferable
you can ask me anything related to question

https://stackoverflow.com/questions/65812788/how-to-render-a-same-component-one-or-multiple-time-using-event-handler January 20, 2021 at 11:42PM

没有评论:

发表评论