diff --git a/src/WidgetBase.ts b/src/WidgetBase.ts index 69b51b2c..fad0de0d 100644 --- a/src/WidgetBase.ts +++ b/src/WidgetBase.ts @@ -587,12 +587,7 @@ export class WidgetBase
extends E
const afterRenders = this.getDecorator('afterRender');
return afterRenders.reduce((dNode: DNode | DNode[], afterRenderFunction: AfterRender) => {
- const updatedDNode = afterRenderFunction.call(this, dNode);
- if (!updatedDNode) {
- console.warn('DNodes not returned from afterRender, using existing dNodes');
- return dNode;
- }
- return updatedDNode;
+ return afterRenderFunction.call(this, dNode);
}, dNode);
}
diff --git a/tests/unit/WidgetBase.ts b/tests/unit/WidgetBase.ts
index d63ce2fe..be324a29 100644
--- a/tests/unit/WidgetBase.ts
+++ b/tests/unit/WidgetBase.ts
@@ -777,23 +777,6 @@ registerSuite({
const widget = new TestWidget();
widget.__render__();
assert.strictEqual(afterRenderCount, 1);
- },
- 'Use previous DNodes when an afterRender does not return DNodes'() {
- class TestWidget extends WidgetBase {
- @afterRender()
- protected firstBeforeRender(dNode: DNode | DNode[]) {
- return 'first render';
- }
-
- @afterRender()
- protected secondBeforeRender(dNode: DNode | DNode[]) { }
- }
-
- const widget = new TestWidget();
- const vNode =