Skip to content

Instantly share code, notes, and snippets.

@iwata-n
Last active February 11, 2016 23:12
Show Gist options
  • Save iwata-n/c2f4ef386ce95adadf63 to your computer and use it in GitHub Desktop.
Save iwata-n/c2f4ef386ce95adadf63 to your computer and use it in GitHub Desktop.
react-router v2.0.0系でURLにハッシュ値を付けないようにする ref: http://qiita.com/iwata-n@github/items/6608a9e11adc13b913ca
import React from 'react';
import ReactDOM from 'react-dom';
import { Router, useRouterHistory } from 'react-router';
import { createHashHistory } from 'history';
import AppRoutes from './Routes';
const appHistory = useRouterHistory(createHashHistory)({ queryKey: false })
ReactDOM.render(
<Router history={appHistory} onUpdate={() => window.scrollTo(0, 0)}>
{AppRoutes}
</Router>
, document.getElementById('main'));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment