MCPcopy
hub / github.com/facebook/react / commitUpdate

Function commitUpdate

packages/react-native-renderer/src/ReactFiberConfigNative.js:445–468  ·  view source on GitHub ↗
(
  instance: Instance,
  type: string,
  oldProps: Props,
  newProps: Props,
  internalInstanceHandle: Object,
)

Source from the content-addressed store, hash-verified

443}
444
445export function commitUpdate(
446 instance: Instance,
447 type: string,
448 oldProps: Props,
449 newProps: Props,
450 internalInstanceHandle: Object,
451): void {
452 const viewConfig = instance.viewConfig;
453
454 updateFiberProps(instance._nativeTag, newProps);
455
456 const updatePayload = diff(oldProps, newProps, viewConfig.validAttributes);
457
458 // Avoid the overhead of bridge calls if there's no update.
459 // This is an expensive no-op for Android, and causes an unnecessary
460 // view invalidation for certain components (eg RCTTextInput) on iOS.
461 if (updatePayload != null) {
462 UIManager.updateView(
463 instance._nativeTag, // reactTag
464 viewConfig.uiViewClassName, // viewName
465 updatePayload, // props
466 );
467 }
468}
469
470export function insertBefore(
471 parentInstance: Instance,

Callers

nothing calls this directly

Calls 2

updateFiberPropsFunction · 0.90
diffFunction · 0.90

Tested by

no test coverage detected