Skip to content

Commit

Permalink
Simplified Component constructor.
Browse files Browse the repository at this point in the history
  • Loading branch information
sjohnsonaz committed Sep 18, 2018
1 parent 3edc7d0 commit 9b9c560
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions src/scripts/dom/Component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ componentContext.context = componentContext.context || undefined;

export abstract class Component<T> implements IVirtualNode<T> {
// TODO: Remove unused uniqueId?
uniqueId: number;
uniqueId: number = Math.floor(Math.random() * 1000000);
props: T & IVirtualNodeProps;
prevProps: T & IVirtualNodeProps;
children: any;
Expand All @@ -32,8 +32,6 @@ export abstract class Component<T> implements IVirtualNode<T> {
portal: boolean = false;

constructor(props?: T & IVirtualNodeProps, children?: any[]) {
// TODO: Remove unused uniqueId?
this.uniqueId = Math.floor(Math.random() * 1000000);
this.storeProps(props, children);
}

Expand Down

0 comments on commit 9b9c560

Please sign in to comment.