Last active
February 11, 2016 23:12
-
-
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
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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