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 1664fd8 commit 6402161Copy full SHA for 6402161
packages/svelte/src/internal/client/dom/elements/attachments.js
@@ -6,6 +6,10 @@ import { effect } from '../../reactivity/effects.js';
6
*/
7
export function attach(node, get_fn) {
8
effect(() => {
9
- return (get_fn())?.(node);
+ const fn = get_fn();
10
+
11
+ // we use `&&` rather than `?.` so that things like
12
+ // `{@attach DEV && something_dev_only()}` work
13
+ return fn && fn(node);
14
});
15
}
0 commit comments