I am trying to call two multiple functions onClick.It doesn't work when i try to do it.But it works in single function.these are the two functions.
//first function
saveValue = (e) => {
// console.log('savecategory', e.target.innerHTML);
this.setState({
category: e.target.innerHTML
}, this.makeAxiosRequest);
};
//second function
goToLastPage = () => {
const {currentPage, pages, end} = this.state;
};
This is the onClick event i am trying to work.
<button onclick={()=>{this.saveValue();this.goToLastPage()}}>Residence</button>
But it doesn't work.It only works if i call it as a single function like this.
<button onClick={this.saveValue}>Residence</button>
<button onClick={this.goToLastPage}>Residence</button>
How can i make it work?