title: Changing page in react from a function on click
body: <p>I am using React-router and I want to change page from a function. The function is called onclicking a button in sidebar . I could do it with swapping buttons to a Link tag in react-router. However I want some styles to apply then change the page to render new component. SO how to change page from a function.</p>
  
  <p>I have tried history.push and redirect in react router but both didnt work. </p>