From b0cad3370d2a3f3184f57da99313ff6c93ccf768 Mon Sep 17 00:00:00 2001 From: Tim Neutkens Date: Mon, 31 Dec 2018 19:05:49 +0100 Subject: [PATCH] Use less code to detect replace instead of push (#5969) --- packages/next/client/link.js | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/packages/next/client/link.js b/packages/next/client/link.js index e1d579e6..4ce6599a 100644 --- a/packages/next/client/link.js +++ b/packages/next/client/link.js @@ -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) {