Open
Description
If you try to use this
within methods called by {{on}}
and {{fn}}
, they show a helpful error instructing the developer to use the @action
decorator. The render modifiers could show something like that too.
Here's an example "error" use case for did-insert
:
<div class="my-container" {{did-insert this.renderEditor}}></div>
import Component from '@glimmer/component';
export default class CodeEditor extends Component {
renderEditor(el) {
console.log(this.args.code)
}
}
TypeError: this is undefined
{{fn}}
uses this error message:
You accessed
this.arg2
from a function passed to thefn
helper, but the function itself was not bound to a validthis
context. Consider updating to usage of@action
.
Metadata
Metadata
Assignees
Labels
No labels