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

Function commitUpdate

packages/react-noop-renderer/src/createReactNoop.js:736–762  ·  view source on GitHub ↗
(
          instance: Instance,
          type: string,
          oldProps: Props,
          newProps: Props,
        )

Source from the content-addressed store, hash-verified

734 },
735
736 commitUpdate(
737 instance: Instance,
738 type: string,
739 oldProps: Props,
740 newProps: Props,
741 ): void {
742 if (oldProps === null) {
743 throw new Error('Should have old props');
744 }
745 hostUpdateCounter++;
746 instance.prop = newProps.prop;
747 instance.hidden = !!newProps.hidden;
748
749 if (type === 'suspensey-thing' && typeof newProps.src === 'string') {
750 instance.src = newProps.src;
751 }
752
753 if (shouldSetTextContent(type, newProps)) {
754 if (__DEV__) {
755 checkPropStringCoercion(newProps.children, 'children');
756 }
757 instance.text = computeText(
758 (newProps.children: any) + '',
759 instance.context,
760 );
761 }
762 },
763
764 commitTextUpdate(
765 textInstance: TextInstance,

Callers

nothing calls this directly

Calls 3

checkPropStringCoercionFunction · 0.90
computeTextFunction · 0.85
shouldSetTextContentFunction · 0.70

Tested by

no test coverage detected