未验证 提交 b0cad337 编写于 作者: T Tim Neutkens 提交者: GitHub

Use less code to detect replace instead of push (#5969)

上级 36164ead
......@@ -83,11 +83,7 @@ class Link extends Component {
}
// replace state instead of push if prop is present
const { replace } = this.props
const changeMethod = replace ? 'replace' : 'push'
// straight up redirect
Router[changeMethod](href, as, { shallow: this.props.shallow })
Router[this.props.replace ? 'replace' : 'push'](href, as, { shallow: this.props.shallow })
.then((success) => {
if (!success) return
if (scroll) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册