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 is not bound in created and destroyed, so it's hard to access custom context variables:
exportclassTestComponentextendsRete.Component{constructor(foo){super("Test");this.foo=foo;}created(node){console.log(`Created ${node.id} for ${this.foo}`);// Won't work, because `this` will be `undefined`}}
The function hooks should be bound to the respective class instance.
Background
In my particular use-case, I'd like to have a context variable (equivalent to foo) point at a container DOM element and each node owns a DOM child that is attached to the container DOM element. However, during node creation / destruction I'm unable to find the container DOM element, because this is undefined.
The text was updated successfully, but these errors were encountered:
this
is not bound increated
anddestroyed
, so it's hard to access custom context variables:The function hooks should be bound to the respective class instance.
Background
In my particular use-case, I'd like to have a context variable (equivalent to
foo
) point at a container DOM element and each node owns a DOM child that is attached to the container DOM element. However, during node creation / destruction I'm unable to find the container DOM element, becausethis
isundefined
.The text was updated successfully, but these errors were encountered: