提交 4c52ea1f 编写于 作者: K Kye Hohenberger 提交者: Arunoda Susiripala

Add shallow support to Link (#2012)

上级 9a30f10a
......@@ -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)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册