1
Here are my two functions,
chamaLogin = () => {
this.setState({
redirect: true
});
};
-----------------------------------------------------------------------------
handleSubmit = event => {
event.preventDefault();
const arrInsert = {
nome: this.state.nome,
apelido: this.state.apelido
};
axios.post("http://localhost:3000", arrInsert)
.then(res => {
console.log(res);
console.log(res.data);
})
}
How can I call these two functions in onClick ?
Enter how is your onClick and what in fact it is calling now.
– André Lins
only : onClick={this.handleSubmit}
– Verônica Emschermann
I wanted to call both functions at the same time or one after the other?
– André Lins
can be one after the other, to get better the load... So it would be: first the handleSubmit then the calleLogin
– Verônica Emschermann