Skip to content

Commit 89c2ce9

Browse files
committed
Merge pull request #30 from liady/patch-1
Add basic routing transition, upgrade react-router v2.0.0
2 parents 2ce1a30 + f66b2f7 commit 89c2ce9

File tree

3 files changed

+9
-5
lines changed

3 files changed

+9
-5
lines changed

package.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,9 +55,8 @@
5555
"babel-polyfill": "^6.3.14",
5656
"babel-runtime": "^6.3.19",
5757
"express": "^4.12.3",
58-
"history": "^1.17.0",
5958
"react": "^0.14.6",
6059
"react-dom": "^0.14.6",
61-
"react-router": "^1.0.3"
60+
"react-router": "^2.0.0"
6261
}
6362
}

src/main.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,7 @@ import "babel-polyfill";
88
// Libraries
99
import React from "react";
1010
import ReactDOM from "react-dom";
11-
import { Router } from "react-router";
12-
import createBrowserHistory from 'history/lib/createBrowserHistory'
11+
import { Router, browserHistory } from "react-router";
1312

1413
// Routes
1514
import Routes from './common/components/Routes';
@@ -25,7 +24,7 @@ const DOM_APP_EL_ID = "app";
2524

2625
// Render the router
2726
ReactDOM.render((
28-
<Router history={createBrowserHistory()}>
27+
<Router history={browserHistory}>
2928
{Routes}
3029
</Router>
3130
), document.getElementById(DOM_APP_EL_ID));

src/pages/login/page.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,14 @@
11
import React from "react";
2+
import { browserHistory } from "react-router";
23
import styles from "./style.css";
34

45

56
export default class LoginPage extends React.Component {
7+
8+
signUp() {
9+
browserHistory.push("/home");
10+
}
11+
612
render() {
713
return (
814
<div className={styles.content}>

0 commit comments

Comments
 (0)