From 5adfdd6fe05a59899674c0185f0a0c52957869c1 Mon Sep 17 00:00:00 2001 From: Alex Berg Date: Fri, 19 Jan 2018 01:22:08 -0600 Subject: [PATCH 1/2] Hydrate on first load, not destroy --- src/runtime/index.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/runtime/index.ts b/src/runtime/index.ts index b7144b2..77ab99a 100644 --- a/src/runtime/index.ts +++ b/src/runtime/index.ts @@ -60,7 +60,7 @@ function render(Component: ComponentConstructor, data: any, scroll: ScrollPositi component = new Component({ target, data, - hydrate: !!component + hydrate: !component }); if (scroll) { @@ -73,7 +73,7 @@ function prepare_route(Component: ComponentConstructor, data: RouteData) { return { Component, data }; } - if (!component && window.__SAPPER__ && window.__SAPPER__.preloaded) { + if (!component && window.__SAComponentPPER__ && window.__SAPPER__.preloaded) { return { Component, data: Object.assign(data, window.__SAPPER__.preloaded) }; } @@ -224,4 +224,4 @@ export function goto(href: string, opts = { replaceState: false }) { } else { window.location.href = href; } -} \ No newline at end of file +} From 90cd3471125cb8ef15a68776e7c436fcb90305f4 Mon Sep 17 00:00:00 2001 From: Alex Berg Date: Fri, 19 Jan 2018 01:25:20 -0600 Subject: [PATCH 2/2] Fix typo --- src/runtime/index.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/runtime/index.ts b/src/runtime/index.ts index 77ab99a..c30a89d 100644 --- a/src/runtime/index.ts +++ b/src/runtime/index.ts @@ -73,7 +73,7 @@ function prepare_route(Component: ComponentConstructor, data: RouteData) { return { Component, data }; } - if (!component && window.__SAComponentPPER__ && window.__SAPPER__.preloaded) { + if (!component && window.__SAPPER__ && window.__SAPPER__.preloaded) { return { Component, data: Object.assign(data, window.__SAPPER__.preloaded) }; }