From a0534a17c7c638ec320ea57d9f76793a3ec72252 Mon Sep 17 00:00:00 2001 From: Oliver Ford Date: Sun, 1 Aug 2021 11:15:27 +0100 Subject: [PATCH] Fix #6606: warning on reactive use of module const This generated a warning: while this did not: We don't need a warning to tell us that we will not be reactive to a variable that isn't going to change anyway; regardless of whether or not it's in a module. (Maybe there should be a 'no reactive variable used' warning, but this also happens in cases where other mutable variables are used; such as a shared const formatter function, formatting a prop.) --- src/compiler/compile/Component.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/compiler/compile/Component.ts b/src/compiler/compile/Component.ts index 6a8d5b178e..37c48da98c 100644 --- a/src/compiler/compile/Component.ts +++ b/src/compiler/compile/Component.ts @@ -1310,7 +1310,7 @@ export default class Component { if (variable) { variable.is_reactive_dependency = true; - if (variable.module) { + if (variable.module && variable.writable) { should_add_as_dependency = false; module_dependencies.add(name); }