I have a form where it has a standard responsible (NewResponsavel), but if there is any other has to be added a new responsible with each click of the 'add another' button, today I can only add once, if someone would know how to add the same component several times.
New Responder is a component - which has 4 inputs inside it, I just want to repeat the component.
import {NovoResponsavel} from 'components';
class NovoAtendimento extends React.Component {
handleClick() {
this.setState({
clicked: true
});
}
render(){
return (
<NovoResponsavel/>
{this.state.clicked ? <NovoResponsavel /> : null}
<ItemGrid xs={12} sm={12} md={12}>
<a onClick={this.handleClick} className="addnew">
adicionar outro responsável
</a>
</ItemGrid>
);
}