commit 21301338b3100659afddf90748a851326b20be10
parent ad85c269493e355dcd7c4edf85512cdbb2581d84
Author: Konstantin Tarkus <hello@tarkus.me>
Date: Mon, 7 Dec 2015 15:16:50 +0300
Update npm modules
Note: Location.pushState(), Location.replaceState() are deprecated in favor of Location.push(), Location.replace()
Diffstat:
2 files changed, 37 insertions(+), 27 deletions(-)
diff --git a/package.json b/package.json
@@ -5,61 +5,61 @@
"npm": ">=3.1 <4"
},
"dependencies": {
- "babel-core": "5.8.33",
- "bluebird": "3.0.5",
- "classnames": "2.2.0",
+ "babel-core": "5.8.34",
+ "bluebird": "3.0.6",
+ "classnames": "2.2.1",
"eventemitter3": "1.1.1",
"express": "4.13.3",
"fastclick": "1.0.6",
- "fbjs": "0.4.0",
+ "fbjs": "0.5.0",
"flux": "2.1.1",
- "front-matter": "2.0.0",
- "history": "1.13.1",
+ "front-matter": "2.0.1",
+ "history": "1.14.0",
"jade": "1.11.0",
"normalize.css": "3.0.3",
- "react": "0.14.2",
- "react-dom": "0.14.2",
+ "react": "0.14.3",
+ "react-dom": "0.14.3",
"react-routing": "0.0.5",
- "source-map-support": "0.3.3",
- "superagent": "1.4.0"
+ "source-map-support": "0.4.0",
+ "superagent": "1.5.0"
},
"devDependencies": {
"assets-webpack-plugin": "^3.2.0",
- "autoprefixer": "^6.1.0",
+ "autoprefixer": "^6.1.2",
"babel": "^5.8.34",
"babel-eslint": "^4.1.6",
- "babel-loader": "^5.3.3",
+ "babel-loader": "^5.4.0",
"babel-plugin-react-transform": "^1.1.1",
- "browser-sync": "^2.9.12",
+ "browser-sync": "^2.10.0",
"css-loader": "^0.23.0",
"csscomb": "^3.1.8",
- "del": "^2.0.2",
- "eslint": "^1.10.1",
- "eslint-config-airbnb": "^1.0.2",
+ "del": "^2.2.0",
+ "eslint": "^1.10.3",
+ "eslint-config-airbnb": "^2.0.0",
"eslint-loader": "^1.1.1",
- "eslint-plugin-react": "^3.10.0",
- "file-loader": "^0.8.4",
+ "eslint-plugin-react": "^3.11.3",
+ "file-loader": "^0.8.5",
"gaze": "^0.5.2",
"git-repository": "^0.1.1",
"glob": "^6.0.1",
"isomorphic-style-loader": "0.0.5",
- "jest-cli": "^0.7.1",
- "jscs": "^2.5.0",
+ "jest-cli": "^0.8.0",
+ "jscs": "^2.6.0",
"lodash.merge": "^3.3.2",
"mkdirp": "^0.5.1",
"ncp": "^2.0.0",
- "postcss": "^5.0.10",
+ "postcss": "^5.0.12",
"postcss-import": "^7.1.3",
"postcss-loader": "^0.8.0",
"precss": "^1.3.0",
"react-transform-catch-errors": "^1.0.0",
"react-transform-hmr": "^1.0.1",
- "redbox-react": "^1.1.1",
+ "redbox-react": "^1.2.0",
"replace": "^0.3.0",
- "url-loader": "^0.5.6",
+ "url-loader": "^0.5.7",
"webpack": "^1.12.9",
"webpack-dev-middleware": "^1.4.0",
- "webpack-hot-middleware": "^2.5.0"
+ "webpack-hot-middleware": "^2.6.0"
},
"jest": {
"rootDir": "./src",
diff --git a/src/components/Link/Link.js b/src/components/Link/Link.js
@@ -1,6 +1,7 @@
/*! React Starter Kit | MIT License | http://www.reactstarterkit.com/ */
import React, { Component, PropTypes } from 'react';
+import parsePath from 'history/lib/parsePath';
import Location from '../../core/Location';
function isLeftClickEvent(event) {
@@ -40,9 +41,18 @@ class Link extends Component {
if (allowTransition) {
const link = event.currentTarget;
- Location.pushState(
- this.props && this.props.state || null,
- this.props && this.props.to || (link.pathname + link.search));
+ if (this.props && this.props.to) {
+ Location.push({
+ ...(parsePath(this.props.to)),
+ state: this.props && this.props.state || null,
+ });
+ } else {
+ Location.push({
+ pathname: link.pathname,
+ search: link.search,
+ state: this.props && this.props.state || null,
+ });
+ }
}
};