title: Adding a base URL to an app using Redux-Router + React-Router
body: <p>I'm using <a href="https://github.com/rackt/react-router">React-Router</a> 1.0.0-rc3 together with <a href="https://github.com/rackt/redux-router">Redux-Router</a> 1.0.0-beta3.</p>
  
  <p>When using React-Router, you can use <code>useBasename</code> with <code>createHistory</code> to set the base URL for an app, so that you can easily write an app that runs inside a subdirectory. <a href="https://github.com/rackt/react-router/issues/353#issuecomment-148385993">Example</a>:</p>
  
  <p>Instead of this:</p>
  
  <pre><code>import { createHistory } from 'history';
  
  let base = "/app_name/"
  
  &lt;Router history={browserHistory}&gt;
    &lt;Route path={base} component={App}&gt;&lt;/Route&gt;
  &lt;/Router&gt;
  
  &lt;Link path={base + "some_path"}&gt;some_path&lt;/Link&gt;
  </code></pre>
  
  <p>You can write in this way using <code>useBasename</code>:</p>
  
  <pre><code>import { createHistory, useBasename } from 'history';
  
  const browserHistory = useBasename(createHistory)({
    basename: "/app_name"
  });
  
  &lt;Router history={browserHistory}&gt;
    &lt;Route path="/" component={App}&gt;&lt;/Route&gt;
  &lt;/Router&gt;
  
  &lt;Link path="/some_path"&gt;some_path&lt;/Link&gt;
  </code></pre>
  
  <p>However, in Redux-Router, you need to pass <code>createHistory</code> instead of <code>history</code> to a reducer:</p>
  
  <pre><code>const store = compose(
    applyMiddleware(m1, m2, m3),
    reduxReactRouter({
      routes,
      createHistory
    }),
    devTools()
  )(createStore)(reducer);
  </code></pre>
  
  <p>How can we use <code>useBasename</code> in this case?</p>