diff --git a/lib/router.js b/lib/router.js index a0a6e8ed..553c5c3c 100644 --- a/lib/router.js +++ b/lib/router.js @@ -32,11 +32,8 @@ export default class Router { Promise.resolve() .then(async () => { const data = await this.fetchComponent(route) - let props - if (route !== this.route) { - const ctx = { ...data.ctx, pathname, query } - props = await this.getInitialProps(data.Component, ctx) - } + const ctx = { ...data.ctx, pathname, query } + const props = await this.getInitialProps(data.Component, ctx) this.route = route this.set(getURL(), { ...data, props }) @@ -72,10 +69,8 @@ export default class Router { let props try { data = await this.fetchComponent(route) - if (route === this.route) { - const ctx = { ...data.ctx, pathname, query } - props = await this.getInitialProps(data.Component, ctx) - } + const ctx = { ...data.ctx, pathname, query } + props = await this.getInitialProps(data.Component, ctx) } catch (err) { if (err.cancelled) return false throw err @@ -107,10 +102,8 @@ export default class Router { let props try { data = await this.fetchComponent(route) - if (route !== this.route) { - const ctx = { ...data.ctx, pathname, query } - props = await this.getInitialProps(data.Component, ctx) - } + const ctx = { ...data.ctx, pathname, query } + props = await this.getInitialProps(data.Component, ctx) } catch (err) { if (err.cancelled) return false throw err