We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent c5e3548 commit 785f60dCopy full SHA for 785f60d
packages/svelte/src/compiler/phases/3-transform/client/visitors/RegularElement.js
@@ -356,6 +356,9 @@ export function RegularElement(node, context) {
356
// special case — if an element that only contains text, we don't need
357
// to descend into it if the text is non-reactive
358
const is_text = trimmed.every((node) => node.type === 'Text' || node.type === 'ExpressionTag');
359
+
360
+ // in the rare case that we have static text that can't be inlined
361
+ // (e.g. `<span>{location}</span>`), set `textContent` programmatically
362
const use_text_content =
363
is_text &&
364
trimmed.every((node) => node.type === 'Text' || !node.metadata.expression.has_state) &&
0 commit comments