work on composability

This commit is contained in:
Géry Debongnie
2019-01-17 12:49:13 +01:00
parent 70881312fa
commit 9b08e30cf3
5 changed files with 56 additions and 8 deletions
+2 -2
View File
@@ -15,9 +15,9 @@ export default class Counter extends Widget {
counter: 0
};
constructor(parent: Widget | null, initialState?: number) {
constructor(parent: Widget, props: {initialState?: number}) {
super(parent);
this.state.counter = initialState || 0;
this.state.counter = props.initialState || 0;
}
increment(delta: number) {