From af00cf3d7b10b1b79a638bfdf5bd7c7a790b7c5a Mon Sep 17 00:00:00 2001 From: Jeffrey Wescott Date: Mon, 20 Jul 2015 16:51:30 -0700 Subject: [PATCH] abort link transition when location will not change if the current state of the router is the same as the destination of the Link, disallow the transition --- modules/Link.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/modules/Link.js b/modules/Link.js index 92784720a6..07ac9466e9 100644 --- a/modules/Link.js +++ b/modules/Link.js @@ -64,6 +64,11 @@ export var Link = React.createClass({ if (clickResult === false || event.defaultPrevented === true) allowTransition = false; + if (this.context.router.state.location.pathname === this.props.to + && + this.context.router.state.location.query == this.props.query) // == b/c query may be null / undefined + allowTransition = false; + event.preventDefault(); if (allowTransition)