You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This does not "work" – it doesn't error, but it will essentially capture and compile in the value of the foo variable at some arbitrary point and never update again. Even if the component is torn down and a new instance is created/rendered, it will probably still hold on to the old value when the template was initially compiled.
So, generally speaking, one should avoid referencing let variables from within <template> and instead prefer to use const bindings to avoid this confusion/foot-gun.
The text was updated successfully, but these errors were encountered:
This does not "work" – it doesn't error, but it will essentially capture and compile in the value of the
foo
variable at some arbitrary point and never update again. Even if the component is torn down and a new instance is created/rendered, it will probably still hold on to the old value when the template was initially compiled.So, generally speaking, one should avoid referencing
let
variables from within<template>
and instead prefer to useconst
bindings to avoid this confusion/foot-gun.The text was updated successfully, but these errors were encountered: