(
node: DOMElement,
_type: ElementNames,
oldProps: Props,
newProps: Props,
)
| 431 | }, |
| 432 | // React 19 commitUpdate receives old and new props directly instead of an updatePayload |
| 433 | commitUpdate( |
| 434 | node: DOMElement, |
| 435 | _type: ElementNames, |
| 436 | oldProps: Props, |
| 437 | newProps: Props, |
| 438 | ): void { |
| 439 | const props = diff(oldProps, newProps) |
| 440 | const style = diff(oldProps['style'] as Styles, newProps['style'] as Styles) |
| 441 | |
| 442 | if (props) { |
| 443 | for (const [key, value] of Object.entries(props)) { |
| 444 | if (key === 'style') { |
| 445 | setStyle(node, value as Styles) |
| 446 | continue |
| 447 | } |
| 448 | |
| 449 | if (key === 'textStyles') { |
| 450 | setTextStyles(node, value as TextStyles) |
| 451 | continue |
| 452 | } |
| 453 | |
| 454 | if (EVENT_HANDLER_PROPS.has(key)) { |
| 455 | setEventHandler( |
| 456 | node, |
| 457 | key as keyof EventHandlerProps, |
| 458 | value as EventHandlerProps[keyof EventHandlerProps], |
| 459 | ) |
| 460 | continue |
| 461 | } |
| 462 | |
| 463 | setAttribute(node, key, value as DOMNodeAttribute) |
| 464 | } |
| 465 | } |
| 466 | |
| 467 | if (style && node.yogaNode) { |
| 468 | applyStyles(node.yogaNode, style, newProps['style'] as Styles) |
| 469 | } |
| 470 | }, |
| 471 | commitTextUpdate(node: TextNode, _oldText: string, newText: string): void { |
| 472 | setTextNodeValue(node, newText) |
| 473 | }, |
nothing calls this directly
no test coverage detected