I created a react app and implemented two routes.
The Page on '/' shows a welcome message and /pageone shows the other page.
i have button in homepage( "/" ) which is wrapped with link to="/pageone".
I have a function
onClose = () => {this.setState({visible:false,});}i want it to run first after that only i want to change my route onclicking/
how to achieve this? is there any way to write a function that runs this onClose function and then route to the link?