Repository: facebook/react
File: packages/react-reconciler/src/ReactFiberCommitWork.js (JavaScript)

Code before:
            // For hydration we reuse the update path but we treat the oldProps
            // as the newProps. The updatePayload will contain the real change in
            // this case.
            const newProps = finishedWork.memoizedProps;
            const oldProps =
              current !== null ? current.memoizedProps : newProps;
            commitHostUpdate(finishedWork, newProps, oldProps);
          }
        }

        if (flags & FormReset) {
          needsFormReset = true;
          if (__DEV__) {
            if (finishedWork.type !== 'form') {
              // Paranoid coding. In case we accidentally start using the
              // FormReset bit for something else.
              console.error(
                'Unexpected host component type. Expected a form. This is a ' +
                  'bug in React.',
              );
            }
          }
        }
      } else {
        if (enableEagerAlternateStateNodeCleanup) {
          if (supportsPersistence && finishedWork.alternate !== null) {
            // `finishedWork.alternate.stateNode` is pointing to a stale shadow
            // node at this point, retaining it and its subtree. To reclaim
            // memory, point `alternate.stateNode` to new shadow node. This
            // prevents shadow node from staying in memory longer than it
            // needs to. The correct behaviour of this is checked by test in
            // React Native: ShadowNodeReferenceCounter-itest.js#L150
            finishedWork.alternate.stateNode = finishedWork.stateNode;
          }
        }
      }
      break;
    }
    case HostText: {
      recursivelyTraverseMutationEffects(root, finishedWork, lanes);
      commitReconciliationEffects(finishedWork, lanes);

      if (flags & Update) {
        if (supportsMutation) {
          if (finishedWork.stateNode === null) {
            throw new Error(
              'This should have a text node initialized. This error is likely ' +
                'caused by a bug in React. Please file an issue.',
            );
          }


Review comment (suggestion):
Everywhere else we do these checks have conds only for `supportsPersistence` or `supportsMutation`, can we match that here? 

```js
else if (supportsPersistence) {
  ...
}
```

Not sure if it has DCE benefits, but it makes it consistent to read across the codebase.

Code after:
            // For hydration we reuse the update path but we treat the oldProps
            // as the newProps. The updatePayload will contain the real change in
            // this case.
            const newProps = finishedWork.memoizedProps;
            const oldProps =
              current !== null ? current.memoizedProps : newProps;
            commitHostUpdate(finishedWork, newProps, oldProps);
          }
        }

        if (flags & FormReset) {
          needsFormReset = true;
          if (__DEV__) {
            if (finishedWork.type !== 'form') {
              // Paranoid coding. In case we accidentally start using the
              // FormReset bit for something else.
              console.error(
                'Unexpected host component type. Expected a form. This is a ' +
                  'bug in React.',
              );
            }
          }
        }
      } else {
        if (enableEagerAlternateStateNodeCleanup) {
          if (supportsPersistence) {
            if (finishedWork.alternate !== null) {
              // `finishedWork.alternate.stateNode` is pointing to a stale shadow
              // node at this point, retaining it and its subtree. To reclaim
              // memory, point `alternate.stateNode` to new shadow node. This
              // prevents shadow node from staying in memory longer than it
              // needs to. The correct behaviour of this is checked by test in
              // React Native: ShadowNodeReferenceCounter-itest.js#L150
              finishedWork.alternate.stateNode = finishedWork.stateNode;
            }
          }
        }
      }
      break;
    }
    case HostText: {
      recursivelyTraverseMutationEffects(root, finishedWork, lanes);
      commitReconciliationEffects(finishedWork, lanes);

      if (flags & Update) {
        if (supportsMutation) {
          if (finishedWork.stateNode === null) {
            throw new Error(
              'This should have a text node initialized. This error is likely ' +
                'caused by a bug in React. Please file an issue.',
            );