From 6b1aa7aa6048eec67d74c20af423e6b09e98973b Mon Sep 17 00:00:00 2001 From: Ivan Diaz Date: Tue, 6 Oct 2015 19:50:35 -0300 Subject: [PATCH] [Ivan Diaz] - Update react-router --- package.json | 2 +- src/app/App.js | 3 +-- src/app/Routes.js | 19 +++++++++++-------- src/app/index.js | 4 +--- src/app/main/main-layout-header.js | 4 ++-- src/app/main/main-layout.js | 3 +-- src/core-components/button.js | 6 +++--- 7 files changed, 20 insertions(+), 21 deletions(-) diff --git a/package.json b/package.json index 83e72643..b757857c 100644 --- a/package.json +++ b/package.json @@ -51,7 +51,7 @@ "react": "^0.13.x", "react-document-title": "^1.0.2", "react-motion": "^0.3.0", - "react-router": "^0.13.x", + "react-router": "^1.0.0-rc1", "reflux": "^0.2.9", "run-sequence": "^1.1.1", "superagent": "^1.2.0", diff --git a/src/app/App.js b/src/app/App.js index c4a1b1b5..ea78ce40 100644 --- a/src/app/App.js +++ b/src/app/App.js @@ -13,8 +13,7 @@ var App = React.createClass({ render() { return (
- + {this.props.children}
); }, diff --git a/src/app/Routes.js b/src/app/Routes.js index aa3898c2..8854c728 100644 --- a/src/app/Routes.js +++ b/src/app/Routes.js @@ -1,5 +1,6 @@ import React from 'react/addons'; -import {Route, NotFoundRoute, DefaultRoute} from 'react-router'; +import {Router, Route, IndexRoute} from 'react-router'; +import CreateBrowserHistory from 'react-router/node_modules/history/lib/createBrowserHistory'; import App from 'app/App'; import DemoPage from 'app/demo/components-demo-page'; @@ -10,14 +11,16 @@ import MainSignUpPage from 'app/main/main-signup/main-sign export default ( - + + - - - - + + + + - + - + + ); \ No newline at end of file diff --git a/src/app/index.js b/src/app/index.js index 647b0627..959a6341 100644 --- a/src/app/index.js +++ b/src/app/index.js @@ -8,6 +8,4 @@ if ( process.env.NODE_ENV !== 'production' ) { window.React = React; } -Router.run(routes, Router.HistoryLocation, (Handler, state) => { - React.render(, document.getElementById('app')); -}); \ No newline at end of file +React.render(routes, document.getElementById('app')); \ No newline at end of file diff --git a/src/app/main/main-layout-header.js b/src/app/main/main-layout-header.js index acf387b8..5562c381 100644 --- a/src/app/main/main-layout-header.js +++ b/src/app/main/main-layout-header.js @@ -9,8 +9,8 @@ var MainLayoutHeader = React.createClass({ return (
- - + +
diff --git a/src/app/main/main-layout.js b/src/app/main/main-layout.js index 09f2900f..429762be 100644 --- a/src/app/main/main-layout.js +++ b/src/app/main/main-layout.js @@ -12,8 +12,7 @@ var MainLayout = React.createClass({ - + {this.props.children} diff --git a/src/core-components/button.js b/src/core-components/button.js index b59dc21b..20d00b18 100644 --- a/src/core-components/button.js +++ b/src/core-components/button.js @@ -1,12 +1,12 @@ import React from 'react/addons'; import classNames from 'classnames'; -import {Navigation} from 'react-router'; +import {History} from 'react-router'; import callback from 'utils/callback'; var Button = React.createClass({ - mixins: [Navigation], + mixins: [History], propTypes: { children: React.PropTypes.node, @@ -49,7 +49,7 @@ var Button = React.createClass({ handleClick() { if (this.props.route) { - this.transitionTo(this.props.route.to, this.props.route.param, this.props.route.query); + this.history.pushState(null, this.props.route.to, this.props.route.query); } } });