mirror of
https://github.com/terribleplan/next.js.git
synced 2024-01-19 02:48:18 +00:00
Use less code to detect replace instead of push (#5969)
This commit is contained in:
parent
36164ead80
commit
b0cad3370d
|
@ -83,11 +83,7 @@ class Link extends Component {
|
||||||
}
|
}
|
||||||
|
|
||||||
// replace state instead of push if prop is present
|
// replace state instead of push if prop is present
|
||||||
const { replace } = this.props
|
Router[this.props.replace ? 'replace' : 'push'](href, as, { shallow: this.props.shallow })
|
||||||
const changeMethod = replace ? 'replace' : 'push'
|
|
||||||
|
|
||||||
// straight up redirect
|
|
||||||
Router[changeMethod](href, as, { shallow: this.props.shallow })
|
|
||||||
.then((success) => {
|
.then((success) => {
|
||||||
if (!success) return
|
if (!success) return
|
||||||
if (scroll) {
|
if (scroll) {
|
||||||
|
|
Loading…
Reference in a new issue