Skip to content
Permalink

Comparing changes

This is a direct comparison between two commits made in this repository or its related repositories. View the default comparison for this range or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: facebook/react
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 838fd42f8e129e0c732175fb9b88d0b984174e3d
Choose a base ref
..
head repository: facebook/react
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 3966f77c97eb40a23b7e685b6488a72cb6e4727a
Choose a head ref
2 changes: 1 addition & 1 deletion packages/react-reconciler/src/ReactFiberThenable.js
Original file line number Diff line number Diff line change
@@ -214,7 +214,7 @@ export function trackUsedThenable<T>(
}

// Check one more time in case the thenable resolved synchronously.
switch ((thenable as Thenable<T>).status) {
switch ((thenable: Thenable<T>).status) {
case 'fulfilled': {
const fulfilledThenable: FulfilledThenable<T> = (thenable: any);
return fulfilledThenable.value;
2 changes: 1 addition & 1 deletion packages/react-server/src/ReactFizzThenable.js
Original file line number Diff line number Diff line change
@@ -107,7 +107,7 @@ export function trackUsedThenable<T>(
}

// Check one more time in case the thenable resolved synchronously
switch ((thenable as Thenable<T>).status) {
switch ((thenable: Thenable<T>).status) {
case 'fulfilled': {
const fulfilledThenable: FulfilledThenable<T> = (thenable: any);
return fulfilledThenable.value;
2 changes: 1 addition & 1 deletion packages/react-server/src/ReactFlightThenable.js
Original file line number Diff line number Diff line change
@@ -107,7 +107,7 @@ export function trackUsedThenable<T>(
}

// Check one more time in case the thenable resolved synchronously
switch ((thenable as Thenable<T>).status) {
switch ((thenable: Thenable<T>).status) {
case 'fulfilled': {
const fulfilledThenable: FulfilledThenable<T> = (thenable: any);
return fulfilledThenable.value;
4 changes: 2 additions & 2 deletions packages/react/src/ReactChildren.js
Original file line number Diff line number Diff line change
@@ -42,7 +42,7 @@ function escape(key: string): string {
':': '=2',
};
const escapedString = key.replace(escapeRegex, function (match) {
// $FlowFixMe[invalid-computed-prop]
// $FlowFixMe[invalid-computed-prop]
return escaperLookup[match];
});

@@ -128,7 +128,7 @@ function resolveThenable<T>(thenable: Thenable<T>): T {
}

// Check one more time in case the thenable resolved synchronously.
switch ((thenable as Thenable<T>).status) {
switch ((thenable: Thenable<T>).status) {
case 'fulfilled': {
const fulfilledThenable: FulfilledThenable<T> = (thenable: any);
return fulfilledThenable.value;
10 changes: 8 additions & 2 deletions packages/react/src/ReactLazy.js
Original file line number Diff line number Diff line change
@@ -61,15 +61,21 @@ function lazyInitializer<T>(payload: Payload<T>): T {
// end up fixing it if the resolution was a concurrency bug.
thenable.then(
moduleObject => {
if ((payload as Payload<T>)._status === Pending || payload._status === Uninitialized) {
if (
(payload: Payload<T>)._status === Pending ||
payload._status === Uninitialized
) {
// Transition to the next state.
const resolved: ResolvedPayload<T> = (payload: any);
resolved._status = Resolved;
resolved._result = moduleObject;
}
},
error => {
if ((payload as Payload<T>)._status === Pending || payload._status === Uninitialized) {
if (
(payload: Payload<T>)._status === Pending ||
payload._status === Uninitialized
) {
// Transition to the next state.
const rejected: RejectedPayload = (payload: any);
rejected._status = Rejected;