I have a react app uses react-router to route between pages. The problem is this: I'm in a page in the following route: http://example.com/my-current-location/ and I want to route to http://example.com/my-next-location/
I tries using
this.props.history.push("/my-next-location")
but that takes my to http://example.com/my-current-location/my-next-location/ which is not what I need.
this.props.history.push("/my-next-location")
What I need is a way to navigate to absolute path. Of course,
location.replace()
won't do since I don't want a full page refresh. How can I achieve this?