The code sample above demonstrates how to implement a basic routing without using any 3rd party libraries.
And in regards to the react-routing library.. it has this concept of a routing table (basically an array) where each route is just a URL path and one or more actions (route handlers) associated with it. Inside a route handler function you're free to do whatever you want, e.g. print to the console, fire up some actions on a worker process, asynchronously fetch some data, render React component etc. (it has no dependency on React and is extremely flexible I believe ).