Search code examples
javascriptreactjsreact-selectreact-starter-kit

Open a link on select using react starter kit


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?


Solution

  • 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);