fix: handle template as a normal tag

pull/18058/head
paoloricciuti 4 months ago
parent 9c1d17e51f
commit f68d6af173

@ -439,7 +439,7 @@ export function RegularElement(node, context) {
// The same applies if it's a `<template>` element, since we need to
// set the value of `hydrate_node` to `node.content`
if (name === 'template') {
if (name === 'template' && !context.state.analysis.custom_renderer) {
needs_reset = true;
child_state.init.push(b.stmt(b.call('$.hydrate_template', arg)));
arg = b.member(arg, 'content');

@ -0,0 +1,5 @@
import { test } from '../../test';
export default test({
html: '<template><p>hello world</p></template>'
});

@ -0,0 +1,7 @@
<script lang="ts">
let greet = $state('hello world');
</script>
<template>
<p>{greet}</p>
</template>
Loading…
Cancel
Save