remove setProps nonsense - this isn't java
This commit is contained in:
@@ -5,15 +5,8 @@ import type { MessageOptions } from "./message"
|
|||||||
|
|
||||||
export abstract class Node<Props> {
|
export abstract class Node<Props> {
|
||||||
readonly children = new Container<Node<unknown>>()
|
readonly children = new Container<Node<unknown>>()
|
||||||
protected props: Props
|
|
||||||
|
|
||||||
constructor(initialProps: Props) {
|
constructor(public props: Props) {}
|
||||||
this.props = initialProps
|
|
||||||
}
|
|
||||||
|
|
||||||
setProps(props: Props) {
|
|
||||||
this.props = props
|
|
||||||
}
|
|
||||||
|
|
||||||
modifyMessageOptions(options: MessageOptions) {}
|
modifyMessageOptions(options: MessageOptions) {}
|
||||||
|
|
||||||
|
|||||||
@@ -81,10 +81,10 @@ const config: HostConfig<
|
|||||||
|
|
||||||
prepareUpdate: () => true,
|
prepareUpdate: () => true,
|
||||||
commitUpdate: (node, payload, type, oldProps, newProps) => {
|
commitUpdate: (node, payload, type, oldProps, newProps) => {
|
||||||
node.setProps(newProps.props)
|
node.props = newProps.props
|
||||||
},
|
},
|
||||||
commitTextUpdate: (node, oldText, newText) => {
|
commitTextUpdate: (node, oldText, newText) => {
|
||||||
node.setProps(newText)
|
node.props = newText
|
||||||
},
|
},
|
||||||
|
|
||||||
// eslint-disable-next-line unicorn/no-null
|
// eslint-disable-next-line unicorn/no-null
|
||||||
|
|||||||
Reference in New Issue
Block a user