Skip to content
This repository was archived by the owner on Oct 26, 2018. It is now read-only.

Commit 204ab3d

Browse files
committed
update example: remove history dep and use react-router 2's built-in browser history
1 parent fe88422 commit 204ab3d

File tree

2 files changed

+4
-7
lines changed

2 files changed

+4
-7
lines changed

examples/basic/app.js

+3-5
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,13 @@ import React from 'react'
66
import ReactDOM from 'react-dom'
77
import { applyMiddleware, compose, createStore, combineReducers } from 'redux'
88
import { Provider } from 'react-redux'
9-
import { Router, Route, IndexRoute } from 'react-router'
10-
import createHistory from 'history/lib/createHashHistory'
9+
import { Router, Route, IndexRoute, browserHistory } from 'react-router'
1110
import { syncHistory, routeReducer } from 'react-router-redux'
1211

1312
import * as reducers from './reducers'
1413
import { App, Home, Foo, Bar } from './components'
1514

16-
const history = createHistory()
17-
const middleware = syncHistory(history)
15+
const middleware = syncHistory(browserHistory)
1816
const reducer = combineReducers({
1917
...reducers,
2018
routing: routeReducer
@@ -37,7 +35,7 @@ middleware.listenForReplays(store)
3735
ReactDOM.render(
3836
<Provider store={store}>
3937
<div>
40-
<Router history={history}>
38+
<Router history={browserHistory}>
4139
<Route path="/" component={App}>
4240
<IndexRoute component={Home}/>
4341
<Route path="foo" component={Foo}/>

examples/basic/package.json

+1-2
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,10 @@
44
"repository": "reactjs/react-router-redux",
55
"license": "MIT",
66
"dependencies": {
7-
"history": "^1.14.0",
87
"react": "^0.14.2",
98
"react-dom": "^0.14.2",
109
"react-redux": "^4.0.0",
11-
"react-router": "^1.0.0",
10+
"react-router": "^2.0.0",
1211
"redux": "^3.0.4",
1312
"react-router-redux": "^2.1.0"
1413
},

0 commit comments

Comments
 (0)