I have:
one = () => {
//do something
}
two = () => {
//do something
}
<div>
<button onClick={/*this.one, this.two (it doens't work)*/}>Go</button>
</div>
How can i call two functions using just one onClick?
I have:
one = () => {
//do something
}
two = () => {
//do something
}
<div>
<button onClick={/*this.one, this.two (it doens't work)*/}>Go</button>
</div>
How can i call two functions using just one onClick?
Try:
<div>
<button onClick={this.one; this.two}>Go</button>
</div>
How to call multiple JavaScript functions in onclick event?
one = () => {
//do something
}
two = () => {
//do something
}
<div>
<button onclick="one();two();">Go</button>
</div>