i want to pass link in button at the time call the api from the button.i can acheive any one of this.how can i call both
Click button for another page in react js
1 Answer
Know the answer? Post it. Somebody with the same question will find it here.
i want to pass link in button at the time call the api from the button.i can acheive any one of this.how can i call both
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Ganesan CRank #369 · 6.8K reputationPosted Aug 25, 2021, 2:05 PM EDT
I think it is not possible to combine button clikck and link event in single click. One thing we can do.In the 'handleSubmit' function, once api call or your logic is done manually route to 'SharePost' component.
handleSubmit () { //Your logic... this.props.history.push(path to navigate) }You can find others ways in the below link.
https://www.telerik.com/blogs/programmatically-navigate-with-react-router