Skip to content

Commit fc3b6a4

Browse files
bowen31337Bowen Li
and
Bowen Li
authored
Fix a few typos (#22154)
Co-authored-by: Bowen Li <[email protected]>
1 parent f5e5291 commit fc3b6a4

25 files changed

+59
-59
lines changed

packages/react-reconciler/src/ReactFiberBeginWork.new.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -1901,7 +1901,7 @@ function shouldRemainOnFallback(
19011901
if (current !== null) {
19021902
const suspenseState: SuspenseState = current.memoizedState;
19031903
if (suspenseState === null) {
1904-
// Currently showing content. Don't hide it, even if ForceSuspenseFallack
1904+
// Currently showing content. Don't hide it, even if ForceSuspenseFallback
19051905
// is true. More precise name might be "ForceRemainSuspenseFallback".
19061906
// Note: This is a factoring smell. Can't remain on a fallback if there's
19071907
// no fallback to remain on.
@@ -1973,7 +1973,7 @@ function updateSuspenseComponent(current, workInProgress, renderLanes) {
19731973
pushSuspenseContext(workInProgress, suspenseContext);
19741974

19751975
// OK, the next part is confusing. We're about to reconcile the Suspense
1976-
// boundary's children. This involves some custom reconcilation logic. Two
1976+
// boundary's children. This involves some custom reconciliation logic. Two
19771977
// main reasons this is so complicated.
19781978
//
19791979
// First, Legacy Mode has different semantics for backwards compatibility. The

packages/react-reconciler/src/ReactFiberBeginWork.old.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -1901,7 +1901,7 @@ function shouldRemainOnFallback(
19011901
if (current !== null) {
19021902
const suspenseState: SuspenseState = current.memoizedState;
19031903
if (suspenseState === null) {
1904-
// Currently showing content. Don't hide it, even if ForceSuspenseFallack
1904+
// Currently showing content. Don't hide it, even if ForceSuspenseFallback
19051905
// is true. More precise name might be "ForceRemainSuspenseFallback".
19061906
// Note: This is a factoring smell. Can't remain on a fallback if there's
19071907
// no fallback to remain on.
@@ -1973,7 +1973,7 @@ function updateSuspenseComponent(current, workInProgress, renderLanes) {
19731973
pushSuspenseContext(workInProgress, suspenseContext);
19741974

19751975
// OK, the next part is confusing. We're about to reconcile the Suspense
1976-
// boundary's children. This involves some custom reconcilation logic. Two
1976+
// boundary's children. This involves some custom reconciliation logic. Two
19771977
// main reasons this is so complicated.
19781978
//
19791979
// First, Legacy Mode has different semantics for backwards compatibility. The

packages/react-reconciler/src/ReactFiberCommitWork.new.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -2095,7 +2095,7 @@ function commitMutationEffectsOnFiber(finishedWork: Fiber, root: FiberRoot) {
20952095
// TODO: The factoring of this phase could probably be improved. Consider
20962096
// switching on the type of work before checking the flags. That's what
20972097
// we do in all the other phases. I think this one is only different
2098-
// because of the shared reconcilation logic below.
2098+
// because of the shared reconciliation logic below.
20992099
const flags = finishedWork.flags;
21002100

21012101
if (flags & ContentReset) {

packages/react-reconciler/src/ReactFiberCommitWork.old.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -2095,7 +2095,7 @@ function commitMutationEffectsOnFiber(finishedWork: Fiber, root: FiberRoot) {
20952095
// TODO: The factoring of this phase could probably be improved. Consider
20962096
// switching on the type of work before checking the flags. That's what
20972097
// we do in all the other phases. I think this one is only different
2098-
// because of the shared reconcilation logic below.
2098+
// because of the shared reconciliation logic below.
20992099
const flags = finishedWork.flags;
21002100

21012101
if (flags & ContentReset) {

packages/react-reconciler/src/ReactFiberCompleteWork.new.js

+7-7
Original file line numberDiff line numberDiff line change
@@ -1231,7 +1231,7 @@ function completeWork(
12311231

12321232
// If this is a newly suspended tree, it might not get committed as
12331233
// part of the second pass. In that case nothing will subscribe to
1234-
// its thennables. Instead, we'll transfer its thennables to the
1234+
// its thenables. Instead, we'll transfer its thenables to the
12351235
// SuspenseList so that it can retry if they resolve.
12361236
// There might be multiple of these in the list but since we're
12371237
// going to wait for all of them anyway, it doesn't really matter
@@ -1241,9 +1241,9 @@ function completeWork(
12411241
// We might bail out of the loop before finding any but that
12421242
// doesn't matter since that means that the other boundaries that
12431243
// we did find already has their listeners attached.
1244-
const newThennables = suspended.updateQueue;
1245-
if (newThennables !== null) {
1246-
workInProgress.updateQueue = newThennables;
1244+
const newThenables = suspended.updateQueue;
1245+
if (newThenables !== null) {
1246+
workInProgress.updateQueue = newThenables;
12471247
workInProgress.flags |= Update;
12481248
}
12491249

@@ -1303,9 +1303,9 @@ function completeWork(
13031303

13041304
// Ensure we transfer the update queue to the parent so that it doesn't
13051305
// get lost if this row ends up dropped during a second pass.
1306-
const newThennables = suspended.updateQueue;
1307-
if (newThennables !== null) {
1308-
workInProgress.updateQueue = newThennables;
1306+
const newThenables = suspended.updateQueue;
1307+
if (newThenables !== null) {
1308+
workInProgress.updateQueue = newThenables;
13091309
workInProgress.flags |= Update;
13101310
}
13111311

packages/react-reconciler/src/ReactFiberCompleteWork.old.js

+7-7
Original file line numberDiff line numberDiff line change
@@ -1231,7 +1231,7 @@ function completeWork(
12311231

12321232
// If this is a newly suspended tree, it might not get committed as
12331233
// part of the second pass. In that case nothing will subscribe to
1234-
// its thennables. Instead, we'll transfer its thennables to the
1234+
// its thenables. Instead, we'll transfer its thenables to the
12351235
// SuspenseList so that it can retry if they resolve.
12361236
// There might be multiple of these in the list but since we're
12371237
// going to wait for all of them anyway, it doesn't really matter
@@ -1241,9 +1241,9 @@ function completeWork(
12411241
// We might bail out of the loop before finding any but that
12421242
// doesn't matter since that means that the other boundaries that
12431243
// we did find already has their listeners attached.
1244-
const newThennables = suspended.updateQueue;
1245-
if (newThennables !== null) {
1246-
workInProgress.updateQueue = newThennables;
1244+
const newThenables = suspended.updateQueue;
1245+
if (newThenables !== null) {
1246+
workInProgress.updateQueue = newThenables;
12471247
workInProgress.flags |= Update;
12481248
}
12491249

@@ -1303,9 +1303,9 @@ function completeWork(
13031303

13041304
// Ensure we transfer the update queue to the parent so that it doesn't
13051305
// get lost if this row ends up dropped during a second pass.
1306-
const newThennables = suspended.updateQueue;
1307-
if (newThennables !== null) {
1308-
workInProgress.updateQueue = newThennables;
1306+
const newThenables = suspended.updateQueue;
1307+
if (newThenables !== null) {
1308+
workInProgress.updateQueue = newThenables;
13091309
workInProgress.flags |= Update;
13101310
}
13111311

packages/react-reconciler/src/ReactFiberFlags.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ export const MountPassiveDev = /* */ 0b10000000000000000000000;
6262
// don't contain effects, by checking subtreeFlags.
6363

6464
export const BeforeMutationMask =
65-
// TODO: Remove Update flag from before mutation phase by re-landing Visiblity
65+
// TODO: Remove Update flag from before mutation phase by re-landing Visibility
6666
// flag logic (see #20043)
6767
Update |
6868
Snapshot |
@@ -88,6 +88,6 @@ export const LayoutMask = Update | Callback | Ref | Visibility;
8888
export const PassiveMask = Passive | ChildDeletion;
8989

9090
// Union of tags that don't get reset on clones.
91-
// This allows certain concepts to persist without recalculting them,
91+
// This allows certain concepts to persist without recalculating them,
9292
// e.g. whether a subtree contains passive effects or portals.
9393
export const StaticMask = LayoutStatic | PassiveStatic | RefStatic;

packages/react-reconciler/src/ReactFiberHooks.new.js

+6-6
Original file line numberDiff line numberDiff line change
@@ -449,7 +449,7 @@ export function renderWithHooks<Props, SecondArg>(
449449
}
450450

451451
// We can assume the previous dispatcher is always this one, since we set it
452-
// at the beginning of the render phase and there's no re-entrancy.
452+
// at the beginning of the render phase and there's no re-entrance.
453453
ReactCurrentDispatcher.current = ContextOnlyDispatcher;
454454

455455
if (__DEV__) {
@@ -553,7 +553,7 @@ export function bailoutHooks(
553553

554554
export function resetHooksAfterThrow(): void {
555555
// We can assume the previous dispatcher is always this one, since we set it
556-
// at the beginning of the render phase and there's no re-entrancy.
556+
// at the beginning of the render phase and there's no re-entrance.
557557
ReactCurrentDispatcher.current = ContextOnlyDispatcher;
558558

559559
if (didScheduleRenderPhaseUpdate) {
@@ -934,7 +934,7 @@ type MutableSourceMemoizedState<Source, Snapshot> = {|
934934
subscribe: MutableSourceSubscribeFn<Source, Snapshot>,
935935
|};
936936

937-
function readFromUnsubcribedMutableSource<Source, Snapshot>(
937+
function readFromUnsubscribedMutableSource<Source, Snapshot>(
938938
root: FiberRoot,
939939
source: MutableSource<Source>,
940940
getSnapshot: MutableSourceGetSnapshotFn<Source, Snapshot>,
@@ -1074,7 +1074,7 @@ function useMutableSource<Source, Snapshot>(
10741074

10751075
// eslint-disable-next-line prefer-const
10761076
let [currentSnapshot, setSnapshot] = dispatcher.useState(() =>
1077-
readFromUnsubcribedMutableSource(root, source, getSnapshot),
1077+
readFromUnsubscribedMutableSource(root, source, getSnapshot),
10781078
);
10791079
let snapshot = currentSnapshot;
10801080

@@ -1208,7 +1208,7 @@ function useMutableSource<Source, Snapshot>(
12081208
): any);
12091209
stateHook.queue = newQueue;
12101210
stateHook.baseQueue = null;
1211-
snapshot = readFromUnsubcribedMutableSource(root, source, getSnapshot);
1211+
snapshot = readFromUnsubscribedMutableSource(root, source, getSnapshot);
12121212
stateHook.memoizedState = stateHook.baseState = snapshot;
12131213
}
12141214

@@ -1949,7 +1949,7 @@ function dispatchAction<S, A>(
19491949
// This is the first update. Create a circular list.
19501950
update.next = update;
19511951
// At the end of the current render, this queue's interleaved updates will
1952-
// be transfered to the pending queue.
1952+
// be transferred to the pending queue.
19531953
pushInterleavedQueue(queue);
19541954
} else {
19551955
update.next = interleaved.next;

packages/react-reconciler/src/ReactFiberHooks.old.js

+6-6
Original file line numberDiff line numberDiff line change
@@ -449,7 +449,7 @@ export function renderWithHooks<Props, SecondArg>(
449449
}
450450

451451
// We can assume the previous dispatcher is always this one, since we set it
452-
// at the beginning of the render phase and there's no re-entrancy.
452+
// at the beginning of the render phase and there's no re-entrance.
453453
ReactCurrentDispatcher.current = ContextOnlyDispatcher;
454454

455455
if (__DEV__) {
@@ -553,7 +553,7 @@ export function bailoutHooks(
553553

554554
export function resetHooksAfterThrow(): void {
555555
// We can assume the previous dispatcher is always this one, since we set it
556-
// at the beginning of the render phase and there's no re-entrancy.
556+
// at the beginning of the render phase and there's no re-entrance.
557557
ReactCurrentDispatcher.current = ContextOnlyDispatcher;
558558

559559
if (didScheduleRenderPhaseUpdate) {
@@ -934,7 +934,7 @@ type MutableSourceMemoizedState<Source, Snapshot> = {|
934934
subscribe: MutableSourceSubscribeFn<Source, Snapshot>,
935935
|};
936936

937-
function readFromUnsubcribedMutableSource<Source, Snapshot>(
937+
function readFromUnsubscribedMutableSource<Source, Snapshot>(
938938
root: FiberRoot,
939939
source: MutableSource<Source>,
940940
getSnapshot: MutableSourceGetSnapshotFn<Source, Snapshot>,
@@ -1074,7 +1074,7 @@ function useMutableSource<Source, Snapshot>(
10741074

10751075
// eslint-disable-next-line prefer-const
10761076
let [currentSnapshot, setSnapshot] = dispatcher.useState(() =>
1077-
readFromUnsubcribedMutableSource(root, source, getSnapshot),
1077+
readFromUnsubscribedMutableSource(root, source, getSnapshot),
10781078
);
10791079
let snapshot = currentSnapshot;
10801080

@@ -1208,7 +1208,7 @@ function useMutableSource<Source, Snapshot>(
12081208
): any);
12091209
stateHook.queue = newQueue;
12101210
stateHook.baseQueue = null;
1211-
snapshot = readFromUnsubcribedMutableSource(root, source, getSnapshot);
1211+
snapshot = readFromUnsubscribedMutableSource(root, source, getSnapshot);
12121212
stateHook.memoizedState = stateHook.baseState = snapshot;
12131213
}
12141214

@@ -1949,7 +1949,7 @@ function dispatchAction<S, A>(
19491949
// This is the first update. Create a circular list.
19501950
update.next = update;
19511951
// At the end of the current render, this queue's interleaved updates will
1952-
// be transfered to the pending queue.
1952+
// be transferred to the pending queue.
19531953
pushInterleavedQueue(queue);
19541954
} else {
19551955
update.next = interleaved.next;

packages/react-reconciler/src/ReactFiberInterleavedUpdates.new.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import type {SharedQueue as ClassQueue} from './ReactUpdateQueue.new';
1212

1313
// An array of all update queues that received updates during the current
1414
// render. When this render exits, either because it finishes or because it is
15-
// interrupted, the interleaved updates will be transfered onto the main part
15+
// interrupted, the interleaved updates will be transferred onto the main part
1616
// of the queue.
1717
let interleavedQueues: Array<
1818
HookQueue<any, any> | ClassQueue<any>,

packages/react-reconciler/src/ReactFiberInterleavedUpdates.old.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import type {SharedQueue as ClassQueue} from './ReactUpdateQueue.old';
1212

1313
// An array of all update queues that received updates during the current
1414
// render. When this render exits, either because it finishes or because it is
15-
// interrupted, the interleaved updates will be transfered onto the main part
15+
// interrupted, the interleaved updates will be transferred onto the main part
1616
// of the queue.
1717
let interleavedQueues: Array<
1818
HookQueue<any, any> | ClassQueue<any>,

packages/react-reconciler/src/ReactFiberNewContext.new.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@ function propagateContextChange_eager<T>(
192192
context: ReactContext<T>,
193193
renderLanes: Lanes,
194194
): void {
195-
// Only used by eager implemenation
195+
// Only used by eager implementation
196196
if (enableLazyContextPropagation) {
197197
return;
198198
}
@@ -322,7 +322,7 @@ function propagateContextChanges<T>(
322322
renderLanes: Lanes,
323323
forcePropagateEntireTree: boolean,
324324
): void {
325-
// Only used by lazy implemenation
325+
// Only used by lazy implementation
326326
if (!enableLazyContextPropagation) {
327327
return;
328328
}
@@ -351,7 +351,7 @@ function propagateContextChanges<T>(
351351
if (dependency.context === context) {
352352
// Match! Schedule an update on this fiber.
353353

354-
// In the lazy implemenation, don't mark a dirty flag on the
354+
// In the lazy implementation, don't mark a dirty flag on the
355355
// dependency itself. Not all changes are propagated, so we can't
356356
// rely on the propagation function alone to determine whether
357357
// something has changed; the consumer will check. In the future, we

packages/react-reconciler/src/ReactFiberNewContext.old.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@ function propagateContextChange_eager<T>(
192192
context: ReactContext<T>,
193193
renderLanes: Lanes,
194194
): void {
195-
// Only used by eager implemenation
195+
// Only used by eager implementation
196196
if (enableLazyContextPropagation) {
197197
return;
198198
}
@@ -322,7 +322,7 @@ function propagateContextChanges<T>(
322322
renderLanes: Lanes,
323323
forcePropagateEntireTree: boolean,
324324
): void {
325-
// Only used by lazy implemenation
325+
// Only used by lazy implementation
326326
if (!enableLazyContextPropagation) {
327327
return;
328328
}
@@ -351,7 +351,7 @@ function propagateContextChanges<T>(
351351
if (dependency.context === context) {
352352
// Match! Schedule an update on this fiber.
353353

354-
// In the lazy implemenation, don't mark a dirty flag on the
354+
// In the lazy implementation, don't mark a dirty flag on the
355355
// dependency itself. Not all changes are propagated, so we can't
356356
// rely on the propagation function alone to determine whether
357357
// something has changed; the consumer will check. In the future, we

packages/react-reconciler/src/ReactFiberReconciler.new.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -381,7 +381,7 @@ function markRetryLaneImpl(fiber: Fiber, retryLane: Lane) {
381381
}
382382
}
383383

384-
// Increases the priority of thennables when they resolve within this boundary.
384+
// Increases the priority of thenables when they resolve within this boundary.
385385
function markRetryLaneIfNotHydrated(fiber: Fiber, retryLane: Lane) {
386386
markRetryLaneImpl(fiber, retryLane);
387387
const alternate = fiber.alternate;

packages/react-reconciler/src/ReactFiberReconciler.old.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -381,7 +381,7 @@ function markRetryLaneImpl(fiber: Fiber, retryLane: Lane) {
381381
}
382382
}
383383

384-
// Increases the priority of thennables when they resolve within this boundary.
384+
// Increases the priority of thenables when they resolve within this boundary.
385385
function markRetryLaneIfNotHydrated(fiber: Fiber, retryLane: Lane) {
386386
markRetryLaneImpl(fiber, retryLane);
387387
const alternate = fiber.alternate;

packages/react-reconciler/src/ReactFiberSyncTaskQueue.new.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ export function flushSyncCallbacksOnlyInLegacyMode() {
5050

5151
export function flushSyncCallbacks() {
5252
if (!isFlushingSyncQueue && syncQueue !== null) {
53-
// Prevent re-entrancy.
53+
// Prevent re-entrance.
5454
isFlushingSyncQueue = true;
5555
let i = 0;
5656
const previousUpdatePriority = getCurrentUpdatePriority();

packages/react-reconciler/src/ReactFiberSyncTaskQueue.old.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ export function flushSyncCallbacksOnlyInLegacyMode() {
5050

5151
export function flushSyncCallbacks() {
5252
if (!isFlushingSyncQueue && syncQueue !== null) {
53-
// Prevent re-entrancy.
53+
// Prevent re-entrance.
5454
isFlushingSyncQueue = true;
5555
let i = 0;
5656
const previousUpdatePriority = getCurrentUpdatePriority();

packages/react-reconciler/src/ReactUpdateQueue.new.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,7 @@ export function enqueueUpdate<State>(
230230
// This is the first update. Create a circular list.
231231
update.next = update;
232232
// At the end of the current render, this queue's interleaved updates will
233-
// be transfered to the pending queue.
233+
// be transferred to the pending queue.
234234
pushInterleavedQueue(sharedQueue);
235235
} else {
236236
update.next = interleaved.next;

packages/react-reconciler/src/ReactUpdateQueue.old.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,7 @@ export function enqueueUpdate<State>(
230230
// This is the first update. Create a circular list.
231231
update.next = update;
232232
// At the end of the current render, this queue's interleaved updates will
233-
// be transfered to the pending queue.
233+
// be transferred to the pending queue.
234234
pushInterleavedQueue(sharedQueue);
235235
} else {
236236
update.next = interleaved.next;

packages/react-reconciler/src/__tests__/ReactEffectOrdering-test.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ describe('ReactHooksWithNoopRenderer', () => {
3232
useLayoutEffect = React.useLayoutEffect;
3333
});
3434

35-
test('layout unmmouts on deletion are fired in parent -> child order', async () => {
35+
test('layout unmounts on deletion are fired in parent -> child order', async () => {
3636
const root = ReactNoop.createRoot();
3737

3838
function Parent() {
@@ -59,7 +59,7 @@ describe('ReactHooksWithNoopRenderer', () => {
5959
expect(Scheduler).toHaveYielded(['Unmount parent', 'Unmount child']);
6060
});
6161

62-
test('passive unmmouts on deletion are fired in parent -> child order', async () => {
62+
test('passive unmounts on deletion are fired in parent -> child order', async () => {
6363
const root = ReactNoop.createRoot();
6464

6565
function Parent() {

0 commit comments

Comments
 (0)