Skip to content

Commit

Permalink
refactor: use optional properties
Browse files Browse the repository at this point in the history
  • Loading branch information
grantjbutler committed Feb 19, 2022
1 parent 622b155 commit ed6dc56
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/renderer/src/layout/Component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import type ContainerComponent from './ContainerComponent';

export default class Component {
id: string = uuidv4();
_parent: WeakRef<ContainerComponent> | undefined = undefined;
customName: string | undefined;
_parent?: WeakRef<ContainerComponent>;
customName?: string;

get name(): string {
return this.customName ?? Object.getPrototypeOf(this).constructor.displayName;
Expand Down

0 comments on commit ed6dc56

Please sign in to comment.