We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent be9ad42 commit 48ab766Copy full SHA for 48ab766
src/BaseComponent.ts
@@ -56,15 +56,17 @@ export abstract class BaseComponent<T extends Element> {
56
/**
57
* Insert component after the last child
58
*/
59
- public append(component: BaseComponent<any>) {
+ public append(component?: BaseComponent<any> | null) {
60
+ if (!component) return this;
61
this.element.appendChild(component.element);
62
return this;
63
}
64
65
66
* Insert component before the first child
67
- public prepend(component: BaseComponent<any>) {
68
+ public prepend(component?: BaseComponent<any> | null) {
69
70
this.element.prepend(component.element);
71
72
0 commit comments