Skip to content

Commit 9bff38d

Browse files
committed
Update to React Router 1.0.0-rc1
1 parent 850c914 commit 9bff38d

File tree

4 files changed

+8
-7
lines changed

4 files changed

+8
-7
lines changed

examples/real-world/containers/App.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ class App extends Component {
1717

1818
handleChange(nextValue) {
1919
// Available thanks to contextTypes below
20-
const { router } = this.context;
21-
router.transitionTo(`/${nextValue}`);
20+
const { history } = this.context;
21+
history.pushState(null, `/${nextValue}`);
2222
}
2323

2424
renderErrorMessage() {
@@ -71,7 +71,7 @@ App.propTypes = {
7171
};
7272

7373
App.contextTypes = {
74-
router: PropTypes.object.isRequired
74+
history: PropTypes.object.isRequired
7575
};
7676

7777
function mapStateToProps(state) {

examples/real-world/containers/RepoPage.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ RepoPage.propTypes = {
6565
repo: PropTypes.object,
6666
fullName: PropTypes.string.isRequired,
6767
name: PropTypes.string.isRequired,
68-
owner: PropTypes.string.isRequired,
68+
owner: PropTypes.object.isRequired,
6969
stargazers: PropTypes.array.isRequired,
7070
stargazersPagination: PropTypes.object,
7171
loadRepo: PropTypes.func.isRequired,

examples/real-world/index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
import 'babel-core/polyfill';
22
import React from 'react';
3-
import BrowserHistory from 'react-router/lib/BrowserHistory';
3+
import createBrowserHistory from 'history/lib/createBrowserHistory';
44
import { Provider } from 'react-redux';
55
import { Router, Route } from 'react-router';
66
import configureStore from './store/configureStore';
77
import App from './containers/App';
88
import UserPage from './containers/UserPage';
99
import RepoPage from './containers/RepoPage';
1010

11-
const history = new BrowserHistory();
11+
const history = createBrowserHistory();
1212
const store = configureStore();
1313

1414
React.render(

examples/real-world/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,14 @@
1515
},
1616
"homepage": "http://rackt.github.io/redux",
1717
"dependencies": {
18+
"history": "^1.9.0",
1819
"humps": "^0.6.0",
1920
"isomorphic-fetch": "^2.1.1",
2021
"lodash": "^3.10.1",
2122
"normalizr": "^1.0.0",
2223
"react": "^0.13.3",
2324
"react-redux": "^2.1.2",
24-
"react-router": "1.0.0-beta3",
25+
"react-router": "^1.0.0-rc1",
2526
"redux": "^3.0.0",
2627
"redux-logger": "0.0.1",
2728
"redux-thunk": "^0.1.0"

0 commit comments

Comments
 (0)