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 GitHub
parent 8244b4b163
commit 44824bfa3d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

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);
}
});