MCPcopy
hub / github.com/claude-code-best/claude-code / commitUpdate

Function commitUpdate

packages/@ant/ink/src/core/reconciler.ts:433–470  ·  view source on GitHub ↗
(
    node: DOMElement,
    _type: ElementNames,
    oldProps: Props,
    newProps: Props,
  )

Source from the content-addressed store, hash-verified

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 },

Callers

nothing calls this directly

Calls 7

setStyleFunction · 0.85
setTextStylesFunction · 0.85
setEventHandlerFunction · 0.85
setAttributeFunction · 0.85
entriesMethod · 0.80
diffFunction · 0.70
hasMethod · 0.45

Tested by

no test coverage detected