Skip to content

Commit ccc6100

Browse files
nickspbvaughn
authored andcommitted
Fix comments typos (#17550)
* Fix comments typos * Fix comments typos * Fix more typos Co-authored-by: Brian Vaughn <brian.david.vaughn@gmail.com>
1 parent 6215e1c commit ccc6100

File tree

2 files changed

+19
-20
lines changed

2 files changed

+19
-20
lines changed

packages/react-reconciler/src/ReactFiberBeginWork.js

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -266,8 +266,8 @@ function forceUnmountCurrentAndReconcile(
266266
);
267267
// In the second pass, we mount the new children. The trick here is that we
268268
// 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.
271271
workInProgress.child = reconcileChildFibers(
272272
workInProgress,
273273
null,
@@ -518,7 +518,7 @@ function updateSimpleMemoComponent(
518518
if (
519519
shallowEqual(prevProps, nextProps) &&
520520
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.
522522
(__DEV__ ? workInProgress.type === current.type : true)
523523
) {
524524
didReceiveUpdate = false;
@@ -807,9 +807,9 @@ function updateClassComponent(
807807
let shouldUpdate;
808808
if (instance === null) {
809809
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
813813
// committed. Disconnect the alternate pointers.
814814
current.alternate = null;
815815
workInProgress.alternate = null;
@@ -906,7 +906,7 @@ function finishClassComponent(
906906
didCaptureError &&
907907
typeof Component.getDerivedStateFromError !== 'function'
908908
) {
909-
// If we captured an error, but getDerivedStateFrom catch is not defined,
909+
// If we captured an error, but getDerivedStateFromError is not defined,
910910
// unmount all the children. componentDidCatch will schedule an update to
911911
// re-render a fallback. This is temporary until we migrate everyone to
912912
// the new API.
@@ -1066,7 +1066,7 @@ function updateHostComponent(current, workInProgress, renderExpirationTime) {
10661066
if (isDirectTextChild) {
10671067
// We special case a direct text child of a host node. This is a common
10681068
// 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
10701070
// avoids allocating another HostText fiber and traversing it.
10711071
nextChildren = null;
10721072
} else if (prevProps !== null && shouldSetTextContent(type, prevProps)) {
@@ -1117,7 +1117,7 @@ function mountLazyComponent(
11171117
renderExpirationTime,
11181118
) {
11191119
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-
11211121
// concurrent tree, in an inconsistent state. We want to treat it like
11221122
// a new mount, even though an empty version of it already committed.
11231123
// Disconnect the alternate pointers.
@@ -2001,7 +2001,7 @@ function updateSuspenseComponent(
20012001
workInProgress.child = primaryChildFragment;
20022002
return fallbackChildFragment;
20032003
} 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
20052005
// normally do.
20062006
workInProgress.memoizedState = null;
20072007
const nextPrimaryChildren = nextProps.children;

packages/react-reconciler/src/ReactFiberCompleteWork.js

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -716,7 +716,7 @@ function completeWork(
716716
const currentHostContext = getHostContext();
717717
// TODO: Move createInstance to beginWork and keep it on a context
718718
// "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
720720
// bottom->up. Top->down is faster in IE11.
721721
let wasHydrated = popHydrationState(workInProgress);
722722
if (wasHydrated) {
@@ -729,7 +729,7 @@ function completeWork(
729729
currentHostContext,
730730
)
731731
) {
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
733733
// commit-phase we mark this as such.
734734
markUpdate(workInProgress);
735735
}
@@ -846,15 +846,14 @@ function completeWork(
846846
} else {
847847
// We should never have been in a hydration state if we didn't have a current.
848848
// 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.
851850
resetHydrationState();
852851
if ((workInProgress.effectTag & DidCapture) === NoEffect) {
853852
// This boundary did not suspend so it's now hydrated and unsuspended.
854853
workInProgress.memoizedState = null;
855854
}
856855
// 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.
858857
// It's also a signal to replay events and the suspense callback.
859858
// If something suspended, schedule an effect to attach retry listeners.
860859
// So we might as well always mark this.
@@ -941,7 +940,7 @@ function completeWork(
941940
// TODO: Only schedule updates if not prevDidTimeout.
942941
if (nextDidTimeout) {
943942
// 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
945944
// primary children.
946945
workInProgress.effectTag |= Update;
947946
}
@@ -950,9 +949,9 @@ function completeWork(
950949
// TODO: Only schedule updates if these values are non equal, i.e. it changed.
951950
if (nextDidTimeout || prevDidTimeout) {
952951
// 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
954953
// 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
956955
// is currently timed out, too.
957956
workInProgress.effectTag |= Update;
958957
}
@@ -991,8 +990,8 @@ function completeWork(
991990
workInProgress.memoizedState;
992991

993992
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.
996995
return null;
997996
}
998997

0 commit comments

Comments
 (0)