DEV: Don't check this.element in @afterRender (#16033)

This would allow to use the decorator in tag-less components and in controllers.
This commit is contained in:
Jarek Radosz 2022-02-23 11:35:20 +01:00 committed by Alan Guo Xiang Tan
parent 72c69a644f
commit 6bbc822495

View File

@ -20,7 +20,7 @@ export function afterRender(target, name, descriptor) {
const originalFunction = descriptor.value;
descriptor.value = function () {
schedule("afterRender", () => {
if (this.element && !this.isDestroying && !this.isDestroyed) {
if (!this.isDestroying && !this.isDestroyed) {
return originalFunction.apply(this, arguments);
}
});