title: change Url when component renders with react-router-dom?
body: <p>Is there a way in react router that whenever some components renders the url changes accordingly.</p>
  
  <p>One way which I know is to place <code>window.history.pushState('', '', '/componentUrl');</code>  in the <code>render function</code> of the component</p>
  
  <p>Is there any better way to accomplish it within the <code>route</code> other than <code>path</code> props in <code>Route</code> because <code>path= 'someurl'</code> means whenever <code>someurl</code> is accessed <code>someComponent</code> should render</p>
  
  <p>But in the other way round whenever <code>someComponent</code>  renders urls should change to <code>someurl</code> I'm taking this senerio in context of conditional rendering inside a <code>component</code>.</p>