@samitouri / QOS-React / commits / ccc6100d7f

Fix comments typos (#17550)

* Fix comments typos * Fix comments typos * Fix more typos Co-authored-by: Brian Vaughn <brian.david.vaughn@gmail.com>

Nick S. Plekhanov committed Dec 22, 2019 at 19:44 UTC ccc6100d7f587551e46c91cce4a0db2c1b72604d
2 files changed +19 -20
packages/react-reconciler/src/ReactFiberBeginWork.js
+10 -10
@@ -266,8 +266,8 @@ function forceUnmountCurrentAndReconcile(
266 );
267 // In the second pass, we mount the new children. The trick here is that we
268 // pass null in place of where we usually pass the current child set. This has
269 - // the effect of remounting all children regardless of whether their their
270 - // identity matches.
269 + // the effect of remounting all children regardless of whether their
270 + // identities match.
271 workInProgress.child = reconcileChildFibers(
272 workInProgress,
273 null,
@@ -518,7 +518,7 @@ function updateSimpleMemoComponent(
518 if (
519 shallowEqual(prevProps, nextProps) &&
520 current.ref === workInProgress.ref &&
521 - // Prevent bailout if the implementation changed due to hot reload:
521 + // Prevent bailout if the implementation changed due to hot reload.
522 (__DEV__ ? workInProgress.type === current.type : true)
523 ) {
524 didReceiveUpdate = false;
@@ -807,9 +807,9 @@ function updateClassComponent(
807 let shouldUpdate;
808 if (instance === null) {
809 if (current !== null) {
810 - // An class component without an instance only mounts if it suspended
811 - // inside a non- concurrent tree, in an inconsistent state. We want to
812 - // tree it like a new mount, even though an empty version of it already
810 + // A class component without an instance only mounts if it suspended
811 + // inside a non-concurrent tree, in an inconsistent state. We want to
812 + // treat it like a new mount, even though an empty version of it already
813 // committed. Disconnect the alternate pointers.
814 current.alternate = null;
815 workInProgress.alternate = null;
@@ -906,7 +906,7 @@ function finishClassComponent(
906 didCaptureError &&
907 typeof Component.getDerivedStateFromError !== 'function'
908 ) {
909 - // If we captured an error, but getDerivedStateFrom catch is not defined,
909 + // If we captured an error, but getDerivedStateFromError is not defined,
910 // unmount all the children. componentDidCatch will schedule an update to
911 // re-render a fallback. This is temporary until we migrate everyone to
912 // the new API.
@@ -1066,7 +1066,7 @@ function updateHostComponent(current, workInProgress, renderExpirationTime) {
1066 if (isDirectTextChild) {
1067 // We special case a direct text child of a host node. This is a common
1068 // case. We won't handle it as a reified child. We will instead handle
1069 - // this in the host environment that also have access to this prop. That
1069 + // this in the host environment that also has access to this prop. That
1070 // avoids allocating another HostText fiber and traversing it.
1071 nextChildren = null;
1072 } else if (prevProps !== null && shouldSetTextContent(type, prevProps)) {
@@ -1117,7 +1117,7 @@ function mountLazyComponent(
1117 renderExpirationTime,
1118 ) {
1119 if (_current !== null) {
1120 - // An lazy component only mounts if it suspended inside a non-
1120 + // A lazy component only mounts if it suspended inside a non-
1121 // concurrent tree, in an inconsistent state. We want to treat it like
1122 // a new mount, even though an empty version of it already committed.
1123 // Disconnect the alternate pointers.
@@ -2001,7 +2001,7 @@ function updateSuspenseComponent(
2001 workInProgress.child = primaryChildFragment;
2002 return fallbackChildFragment;
2003 } else {
2004 - // Still haven't timed out. Continue rendering the children, like we
2004 + // Still haven't timed out. Continue rendering the children, like we
2005 // normally do.
2006 workInProgress.memoizedState = null;
2007 const nextPrimaryChildren = nextProps.children;
packages/react-reconciler/src/ReactFiberCompleteWork.js
+9 -10
@@ -716,7 +716,7 @@ function completeWork(
716 const currentHostContext = getHostContext();
717 // TODO: Move createInstance to beginWork and keep it on a context
718 // "stack" as the parent. Then append children as we go in beginWork
719 - // or completeWork depending on we want to add then top->down or
719 + // or completeWork depending on whether we want to add them top->down or
720 // bottom->up. Top->down is faster in IE11.
721 let wasHydrated = popHydrationState(workInProgress);
722 if (wasHydrated) {
@@ -729,7 +729,7 @@ function completeWork(
729 currentHostContext,
730 )
731 ) {
732 - // If changes to the hydrated node needs to be applied at the
732 + // If changes to the hydrated node need to be applied at the
733 // commit-phase we mark this as such.
734 markUpdate(workInProgress);
735 }
@@ -846,15 +846,14 @@ function completeWork(
846 } else {
847 // We should never have been in a hydration state if we didn't have a current.
848 // However, in some of those paths, we might have reentered a hydration state
849 - // and then we might be inside a hydration state. In that case, we'll need to
850 - // exit out of it.
849 + // and then we might be inside a hydration state. In that case, we'll need to exit out of it.
850 resetHydrationState();
851 if ((workInProgress.effectTag & DidCapture) === NoEffect) {
852 // This boundary did not suspend so it's now hydrated and unsuspended.
853 workInProgress.memoizedState = null;
854 }
855 // If nothing suspended, we need to schedule an effect to mark this boundary
857 - // as having hydrated so events know that they're free be invoked.
856 + // as having hydrated so events know that they're free to be invoked.
857 // It's also a signal to replay events and the suspense callback.
858 // If something suspended, schedule an effect to attach retry listeners.
859 // So we might as well always mark this.
@@ -941,7 +940,7 @@ function completeWork(
940 // TODO: Only schedule updates if not prevDidTimeout.
941 if (nextDidTimeout) {
942 // If this boundary just timed out, schedule an effect to attach a
944 - // retry listener to the proimse. This flag is also used to hide the
943 + // retry listener to the promise. This flag is also used to hide the
944 // primary children.
945 workInProgress.effectTag |= Update;
946 }
@@ -950,9 +949,9 @@ function completeWork(
949 // TODO: Only schedule updates if these values are non equal, i.e. it changed.
950 if (nextDidTimeout || prevDidTimeout) {
951 // If this boundary just timed out, schedule an effect to attach a
953 - // retry listener to the proimse. This flag is also used to hide the
952 + // retry listener to the promise. This flag is also used to hide the
953 // primary children. In mutation mode, we also need the flag to
955 - // *unhide* children that were previously hidden, so check if the
954 + // *unhide* children that were previously hidden, so check if this
955 // is currently timed out, too.
956 workInProgress.effectTag |= Update;
957 }
@@ -991,8 +990,8 @@ function completeWork(
990 workInProgress.memoizedState;
991
992 if (renderState === null) {
994 - // We're running in the default, "independent" mode. We don't do anything
995 - // in this mode.
993 + // We're running in the default, "independent" mode.
994 + // We don't do anything in this mode.
995 return null;
996 }
997