From 486df6479f7c64b28165553b1a3becce757eed4d Mon Sep 17 00:00:00 2001 From: MapleLeaf <19603573+itsMapleLeaf@users.noreply.github.com> Date: Sun, 26 Dec 2021 23:18:50 -0600 Subject: [PATCH] remove setProps nonsense - this isn't java --- library/internal/node.ts | 9 +-------- library/internal/reconciler.ts | 4 ++-- 2 files changed, 3 insertions(+), 10 deletions(-) diff --git a/library/internal/node.ts b/library/internal/node.ts index 346cba2..6328865 100644 --- a/library/internal/node.ts +++ b/library/internal/node.ts @@ -5,15 +5,8 @@ import type { MessageOptions } from "./message" export abstract class Node { readonly children = new Container>() - protected props: Props - constructor(initialProps: Props) { - this.props = initialProps - } - - setProps(props: Props) { - this.props = props - } + constructor(public props: Props) {} modifyMessageOptions(options: MessageOptions) {} diff --git a/library/internal/reconciler.ts b/library/internal/reconciler.ts index dd0c6a9..f8e845d 100644 --- a/library/internal/reconciler.ts +++ b/library/internal/reconciler.ts @@ -81,10 +81,10 @@ const config: HostConfig< prepareUpdate: () => true, commitUpdate: (node, payload, type, oldProps, newProps) => { - node.setProps(newProps.props) + node.props = newProps.props }, commitTextUpdate: (node, oldText, newText) => { - node.setProps(newText) + node.props = newText }, // eslint-disable-next-line unicorn/no-null