Assignments to this
in the render method of a LitElement
are generally a
mistake since it should ideally act like a pure function.
Property updates should usually happen in the other lifecycle methods
(e.g. updated
) or in event handlers.
This rule disallows assigning to this
in the render method.
The following patterns are considered warnings:
render() {
this.prop = 5;
}
The following patterns are not warnings:
render() {
const prop = 5;
}
updated() {
this.prop = 5;
}
If you have non-observed properties you wish to update per render, you may want to disable this rule.