DEV Community

Discussion on: Beginner's experience with React - a shout for feedback

Collapse
 
sergiodxa profile image
Sergio Daniel Xalambrí

What's the best way to 'ADD' a component on the click of a button?

Render the component conditionally based on a a state, when you click the button change the state value so the component will be rendered by React.

Collapse
 
devshehata profile image
Mahmoud Shehata

So yeah Not very different from what I did...
I just thought maybe there is another more clever way....