Skip to content

Commit 429cdcf

Browse files
committed
set default value for constructor config
1 parent 5fe2484 commit 429cdcf

3 files changed

Lines changed: 3 additions & 3 deletions

File tree

src/ts/components/Icon.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { Component, ComponentConfig } from './Component';
22
import { DOM } from '../DOM';
33

44
export class Icon extends Component<ComponentConfig> {
5-
constructor(config: ComponentConfig) {
5+
constructor(config: ComponentConfig = {}) {
66
super(config);
77

88
this.config = this.mergeConfig(

src/ts/components/buttons/Button.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ export class Button<Config extends ButtonConfig> extends Component<Config> {
102102
const buttonElement = new DOM('button', buttonElementAttributes, this);
103103

104104
const addIconElement = () => {
105-
const icon = new Icon({});
105+
const icon = new Icon();
106106
buttonElement.append(icon.getDomElement());
107107
};
108108

src/ts/components/labels/Label.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ export class Label<Config extends LabelConfig> extends Component<Config> {
106106
});
107107

108108
if (this.config.labelStyle !== LabelStyle.Text) {
109-
const icon = new Icon({});
109+
const icon = new Icon();
110110
switch (this.config.labelStyle) {
111111
case LabelStyle.TextWithTrailingIcon:
112112
wrapperElement.append(icon.getDomElement());

0 commit comments

Comments
 (0)