Skip to content

Commit

Permalink
Fix disableStrictPassiveEffect not working under Suspense (#26989)
Browse files Browse the repository at this point in the history
In #26914 I added an extra logic
to turn off double useEffect if there is an `Offscreen`
tag. But `Suspense` uses `Offscreen` tag internally and that turns off
`disableStrictPassiveEffect` for everything.

DiffTrain build for [70e998a](70e998a)
  • Loading branch information
tyao1 committed Jun 22, 2023
1 parent ec1a045 commit b52e425
Show file tree
Hide file tree
Showing 10 changed files with 10 additions and 50 deletions.
2 changes: 1 addition & 1 deletion compiled/facebook-www/REVISION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
254cbdbd6d851a30bf3b649a6cb7c52786766fa4
70e998a1064cc1e8e8f9103e0c00d37fbbcf71c1
2 changes: 1 addition & 1 deletion compiled/facebook-www/React-prod.modern.js
Original file line number Diff line number Diff line change
Expand Up @@ -641,4 +641,4 @@ exports.useSyncExternalStore = function (
);
};
exports.useTransition = useTransition;
exports.version = "18.3.0-www-modern-f829eef9";
exports.version = "18.3.0-www-modern-f3a022db";
7 changes: 1 addition & 6 deletions compiled/facebook-www/ReactART-dev.classic.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ function _assertThisInitialized(self) {
return self;
}

var ReactVersion = "18.3.0-www-classic-786512bb";
var ReactVersion = "18.3.0-www-classic-218ac23d";

var LegacyRoot = 0;
var ConcurrentRoot = 1;
Expand Down Expand Up @@ -28292,11 +28292,6 @@ function createFiberFromSuspenseList(pendingProps, mode, lanes, key) {
return fiber;
}
function createFiberFromOffscreen(pendingProps, mode, lanes, key) {
{
// StrictMode in Offscreen should always run double passive effects
mode &= ~NoStrictPassiveEffectsMode;
}

var fiber = createFiber(OffscreenComponent, pendingProps, key, mode);
fiber.elementType = REACT_OFFSCREEN_TYPE;
fiber.lanes = lanes;
Expand Down
7 changes: 1 addition & 6 deletions compiled/facebook-www/ReactART-dev.modern.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ function _assertThisInitialized(self) {
return self;
}

var ReactVersion = "18.3.0-www-modern-34b19309";
var ReactVersion = "18.3.0-www-modern-a0074376";

var LegacyRoot = 0;
var ConcurrentRoot = 1;
Expand Down Expand Up @@ -27952,11 +27952,6 @@ function createFiberFromSuspenseList(pendingProps, mode, lanes, key) {
return fiber;
}
function createFiberFromOffscreen(pendingProps, mode, lanes, key) {
{
// StrictMode in Offscreen should always run double passive effects
mode &= ~NoStrictPassiveEffectsMode;
}

var fiber = createFiber(OffscreenComponent, pendingProps, key, mode);
fiber.elementType = REACT_OFFSCREEN_TYPE;
fiber.lanes = lanes;
Expand Down
7 changes: 1 addition & 6 deletions compiled/facebook-www/ReactDOM-dev.classic.js
Original file line number Diff line number Diff line change
Expand Up @@ -33919,11 +33919,6 @@ function createFiberFromSuspenseList(pendingProps, mode, lanes, key) {
return fiber;
}
function createFiberFromOffscreen(pendingProps, mode, lanes, key) {
{
// StrictMode in Offscreen should always run double passive effects
mode &= ~NoStrictPassiveEffectsMode;
}

var fiber = createFiber(OffscreenComponent, pendingProps, key, mode);
fiber.elementType = REACT_OFFSCREEN_TYPE;
fiber.lanes = lanes;
Expand Down Expand Up @@ -34214,7 +34209,7 @@ function createFiberRoot(
return root;
}

var ReactVersion = "18.3.0-www-classic-0b2d04c1";
var ReactVersion = "18.3.0-www-classic-ea62c16d";

function createPortal$1(
children,
Expand Down
7 changes: 1 addition & 6 deletions compiled/facebook-www/ReactDOM-dev.modern.js
Original file line number Diff line number Diff line change
Expand Up @@ -33764,11 +33764,6 @@ function createFiberFromSuspenseList(pendingProps, mode, lanes, key) {
return fiber;
}
function createFiberFromOffscreen(pendingProps, mode, lanes, key) {
{
// StrictMode in Offscreen should always run double passive effects
mode &= ~NoStrictPassiveEffectsMode;
}

var fiber = createFiber(OffscreenComponent, pendingProps, key, mode);
fiber.elementType = REACT_OFFSCREEN_TYPE;
fiber.lanes = lanes;
Expand Down Expand Up @@ -34059,7 +34054,7 @@ function createFiberRoot(
return root;
}

var ReactVersion = "18.3.0-www-modern-34b19309";
var ReactVersion = "18.3.0-www-modern-a0074376";

function createPortal$1(
children,
Expand Down
7 changes: 1 addition & 6 deletions compiled/facebook-www/ReactDOMTesting-dev.classic.js
Original file line number Diff line number Diff line change
Expand Up @@ -34536,11 +34536,6 @@ function createFiberFromSuspenseList(pendingProps, mode, lanes, key) {
return fiber;
}
function createFiberFromOffscreen(pendingProps, mode, lanes, key) {
{
// StrictMode in Offscreen should always run double passive effects
mode &= ~NoStrictPassiveEffectsMode;
}

var fiber = createFiber(OffscreenComponent, pendingProps, key, mode);
fiber.elementType = REACT_OFFSCREEN_TYPE;
fiber.lanes = lanes;
Expand Down Expand Up @@ -34831,7 +34826,7 @@ function createFiberRoot(
return root;
}

var ReactVersion = "18.3.0-www-classic-0b64f941";
var ReactVersion = "18.3.0-www-classic-3f09ab7a";

function createPortal$1(
children,
Expand Down
7 changes: 1 addition & 6 deletions compiled/facebook-www/ReactDOMTesting-dev.modern.js
Original file line number Diff line number Diff line change
Expand Up @@ -34381,11 +34381,6 @@ function createFiberFromSuspenseList(pendingProps, mode, lanes, key) {
return fiber;
}
function createFiberFromOffscreen(pendingProps, mode, lanes, key) {
{
// StrictMode in Offscreen should always run double passive effects
mode &= ~NoStrictPassiveEffectsMode;
}

var fiber = createFiber(OffscreenComponent, pendingProps, key, mode);
fiber.elementType = REACT_OFFSCREEN_TYPE;
fiber.lanes = lanes;
Expand Down Expand Up @@ -34676,7 +34671,7 @@ function createFiberRoot(
return root;
}

var ReactVersion = "18.3.0-www-modern-60605377";
var ReactVersion = "18.3.0-www-modern-f6368a4e";

function createPortal$1(
children,
Expand Down
7 changes: 1 addition & 6 deletions compiled/facebook-www/ReactTestRenderer-dev.classic.js
Original file line number Diff line number Diff line change
Expand Up @@ -24392,11 +24392,6 @@ function createFiberFromSuspenseList(pendingProps, mode, lanes, key) {
return fiber;
}
function createFiberFromOffscreen(pendingProps, mode, lanes, key) {
{
// StrictMode in Offscreen should always run double passive effects
mode &= ~NoStrictPassiveEffectsMode;
}

var fiber = createFiber(OffscreenComponent, pendingProps, key, mode);
fiber.elementType = REACT_OFFSCREEN_TYPE;
fiber.lanes = lanes;
Expand Down Expand Up @@ -24565,7 +24560,7 @@ function createFiberRoot(
return root;
}

var ReactVersion = "18.3.0-www-classic-0b64f941";
var ReactVersion = "18.3.0-www-classic-3f09ab7a";

// Might add PROFILE later.

Expand Down
7 changes: 1 addition & 6 deletions compiled/facebook-www/ReactTestRenderer-dev.modern.js
Original file line number Diff line number Diff line change
Expand Up @@ -24392,11 +24392,6 @@ function createFiberFromSuspenseList(pendingProps, mode, lanes, key) {
return fiber;
}
function createFiberFromOffscreen(pendingProps, mode, lanes, key) {
{
// StrictMode in Offscreen should always run double passive effects
mode &= ~NoStrictPassiveEffectsMode;
}

var fiber = createFiber(OffscreenComponent, pendingProps, key, mode);
fiber.elementType = REACT_OFFSCREEN_TYPE;
fiber.lanes = lanes;
Expand Down Expand Up @@ -24565,7 +24560,7 @@ function createFiberRoot(
return root;
}

var ReactVersion = "18.3.0-www-modern-f829eef9";
var ReactVersion = "18.3.0-www-modern-f3a022db";

// Might add PROFILE later.

Expand Down

0 comments on commit b52e425

Please sign in to comment.