I need to grab the value of a key form URL. Let's say the URL is http://localhost:8080/foo=bar. How do I grab the value 'bar' onEnter function with in react-router so that it can be used to trigger other functions.
Thank you in advance.
URL: http://localhost:8080/foo=bar // routes.js var React = require('react'); var ReactRouter = require('react-router'); var Main = require('./templates/main.jsx'); var Sub = require('./templates/sub.jsx'); module.exports = { path: '/', component: Main, indexRoute: { component: Main }, childRoutes: [ { path: '/foo=:bar', component: Sub, onEnter: function(){ // ***************************** // grab the value 'bar' from param } } ] }