From b180f8a67b0bdf716dbc17f53f1b4abcefe117c9 Mon Sep 17 00:00:00 2001 From: James Birtles Date: Wed, 17 Jan 2018 18:07:08 +0000 Subject: [PATCH] create store in _render, fixes #1107 --- src/generators/server-side-rendering/index.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/generators/server-side-rendering/index.ts b/src/generators/server-side-rendering/index.ts index 37bf859da7..c998cb894b 100644 --- a/src/generators/server-side-rendering/index.ts +++ b/src/generators/server-side-rendering/index.ts @@ -114,7 +114,6 @@ export default function ssr( } var result = { head: '', addComponent }; - ${templateProperties.store && `options.store = %store();`} var html = ${name}._render(result, state, options); var cssCode = Array.from(components).map(c => c.css && c.css.code).filter(Boolean).join('\\n'); @@ -130,6 +129,7 @@ export default function ssr( } ${name}._render = function(__result, state, options) { + ${templateProperties.store && `options.store = %store();`} __result.addComponent(${name}); state = Object.assign(${initialState.join(', ')});