From 4c52ea1f70d3636887555b95c9c3c0999fbb102c Mon Sep 17 00:00:00 2001 From: Kye Hohenberger Date: Sat, 20 May 2017 19:54:58 -0700 Subject: [PATCH] Add shallow support to Link (#2012) --- lib/link.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/link.js b/lib/link.js index 9f499f2c..4b3e271e 100644 --- a/lib/link.js +++ b/lib/link.js @@ -26,7 +26,8 @@ export default class Link extends Component { return null } - ]).isRequired + ]).isRequired, + shallow: PropTypes.bool } componentWillReceiveProps (nextProps) { @@ -40,6 +41,7 @@ export default class Link extends Component { return } + let { shallow } = this.props let { href, as } = this if (!isLocal(href)) { @@ -64,7 +66,7 @@ export default class Link extends Component { const changeMethod = replace ? 'replace' : 'push' // straight up redirect - Router[changeMethod](href, as) + Router[changeMethod](href, as, { shallow }) .then((success) => { if (!success) return if (scroll) window.scrollTo(0, 0)