Handling route parameters
The URLs that we've looked at so far in this chapter have all been static. Most applications will use both static and dynamic routes. In this section, you'll learn how to pass dynamic URL segments into your components, how to make these segments optional, and how to get query string parameters.
Resource IDs in routes
A common use case is to make the ID of a backend resource part of the URL. This makes it easy for our code to grab the ID, then make an API call that fetches the relevant resource data. Let's implement a route that renders a user detail page. This will require a route that includes the user ID, which then needs to somehow be passed to the component so that it can fetch the user.
We'll start with the route:
import React from 'react'; import { Router, Route, browserHistory, } from 'react-router'; import UserContainer from './UserContainer'; export default ( <Router history={browserHistory...