@builder.io/mitosis 0.13.1 → 0.13.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -229,7 +229,11 @@ Please add a initial value for every state property even if it's \`undefined\`.`
|
|
|
229
229
|
});
|
|
230
230
|
// Hooks
|
|
231
231
|
if (!emptyOnMount) {
|
|
232
|
-
|
|
232
|
+
// `onMount` runs only in the browser, after view initialization. Guard it
|
|
233
|
+
// so it does not execute during SSR.
|
|
234
|
+
(0, hooks_1.addCodeNgAfterViewInit)(json, `if (typeof window !== 'undefined') {
|
|
235
|
+
${json.hooks.onMount.map((onMount) => onMount.code).join('\n')}
|
|
236
|
+
}`);
|
|
233
237
|
}
|
|
234
238
|
// Angular interfaces
|
|
235
239
|
const angularInterfaces = [];
|
|
@@ -344,9 +348,7 @@ Please add a initial value for every state property even if it's \`undefined\`.`
|
|
|
344
348
|
.filter(([_, value]) => !(0, is_hook_empty_1.isHookEmpty)(value))
|
|
345
349
|
.map(([key, value]) => {
|
|
346
350
|
return `${key}() {
|
|
347
|
-
if (typeof window !== 'undefined') {
|
|
348
351
|
${value.code}
|
|
349
|
-
}
|
|
350
352
|
}`;
|
|
351
353
|
})
|
|
352
354
|
.join('\n')
|