Unverified Commit b0cad337 authored by Tim Neutkens's avatar Tim Neutkens Committed by GitHub

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

parent 36164ead
...@@ -83,11 +83,7 @@ class Link extends Component { ...@@ -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) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment