From 6bf74955b9026fb840163aae44c429a3a746464b Mon Sep 17 00:00:00 2001 From: Jason Date: Tue, 24 May 2016 23:16:30 +0800 Subject: [web] use props.location instead of context.location --- web/src/js/components/proxyapp.js | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'web/src') diff --git a/web/src/js/components/proxyapp.js b/web/src/js/components/proxyapp.js index 82234996..f47c5bb4 100644 --- a/web/src/js/components/proxyapp.js +++ b/web/src/js/components/proxyapp.js @@ -28,14 +28,13 @@ var ProxyAppMain = React.createClass({ location: React.PropTypes.object.isRequired, }, contextTypes: { - location: React.PropTypes.object, router: React.PropTypes.object.isRequired }, updateLocation: function (pathname, queryUpdate) { if (pathname === undefined) { - pathname = this.context.location.pathname; + pathname = this.props.location.pathname; } - var query = this.context.location.query; + var query = this.props.location.query; if (queryUpdate !== undefined) { for (var i in queryUpdate) { if (queryUpdate.hasOwnProperty(i)) { @@ -48,7 +47,7 @@ var ProxyAppMain = React.createClass({ getQuery: function () { // For whatever reason, react-router always returns the same object, which makes comparing // the current props with nextProps impossible. As a workaround, we just clone the query object. - return _.clone(this.context.location.query); + return _.clone(this.props.location.query); }, componentDidMount: function () { this.focus(); -- cgit v1.2.3