-1

I am pretty new to Java script and this could be a really simple answer.

I am using react-starter-kit along with react-select. On a select, a particular function is executed. From within this function, I want the app to navigate to another route (open another url).

How do I accomplish this?

runios
  • 384
  • 1
  • 2
  • 14
  • Show us some code? What did you try? – Boky Dec 07 '16 at 10:34
  • You can follow any example according to your React version [http://stackoverflow.com/questions/31079081/programmatically-navigate-using-react-router](http://stackoverflow.com/questions/31079081/programmatically-navigate-using-react-router) – Anuj Dhanju Dec 07 '16 at 10:37
  • @AnujDhanju react-starter-kit uses universal-router, so those answers may not apply. – runios Dec 07 '16 at 12:14
  • @Boky I am actually pretty lost in terms of how to navigate out. So there is no code to show actually. – runios Dec 07 '16 at 12:16

1 Answers1

0

Ok. I managed to solve this by myself, by following this link

react-starter-kit uses the universal router which handles the routing part of the starter kit. The navigation part is handled by the history module.

To navigate to another part of the app, I just had to import history and then push in the path, like below:

import history from '../../core/history';                
history.push(newpath);
runios
  • 384
  • 1
  • 2
  • 14