Skip to content

Commit 0f81c6b

Browse files
committed
Add stable concurrent option to react-test-renderer (#27804)
## Summary Concurrent rendering has been the default since React 18 release. ReactTestRenderer requires passing `{unstable_isConcurrent: true}` to match this behavior, which means by default tests written with RTR use a different rendering method than the code they test. Eventually, RTR should only use ConcurrentRoot. As a first step, let's add a version of the concurrent option that isn't marked unstable. Next we will follow up with removing the unstable option when it is safe to merge. ## How did you test this change? `yarn test packages/react-test-renderer/src/__tests__/ReactTestRendererAsync-test.js` DiffTrain build for [b36ae8d](b36ae8d)
1 parent 7adeb4a commit 0f81c6b

File tree

4 files changed

+12
-6
lines changed

4 files changed

+12
-6
lines changed

compiled/facebook-www/REVISION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
640ccebb7d9669f1efbd20e86f6f84086c3d698d
1+
b36ae8d7aab94dae285d9d6a1c5f004e6fc19fc9

compiled/facebook-www/React-prod.classic.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -587,4 +587,4 @@ exports.useSyncExternalStore = function (
587587
exports.useTransition = function () {
588588
return ReactCurrentDispatcher.current.useTransition();
589589
};
590-
exports.version = "18.3.0-www-classic-2869b479";
590+
exports.version = "18.3.0-www-classic-786e33e5";

compiled/facebook-www/ReactTestRenderer-dev.classic.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25929,7 +25929,7 @@ if (__DEV__) {
2592925929
return root;
2593025930
}
2593125931

25932-
var ReactVersion = "18.3.0-www-classic-2869b479";
25932+
var ReactVersion = "18.3.0-www-classic-786e33e5";
2593325933

2593425934
// Might add PROFILE later.
2593525935

@@ -26833,7 +26833,10 @@ if (__DEV__) {
2683326833
createNodeMock = options.createNodeMock;
2683426834
}
2683526835

26836-
if (options.unstable_isConcurrent === true) {
26836+
if (
26837+
options.unstable_isConcurrent === true ||
26838+
options.isConcurrent === true
26839+
) {
2683726840
isConcurrent = true;
2683826841
}
2683926842

compiled/facebook-www/ReactTestRenderer-dev.modern.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25929,7 +25929,7 @@ if (__DEV__) {
2592925929
return root;
2593025930
}
2593125931

25932-
var ReactVersion = "18.3.0-www-modern-113f1bd1";
25932+
var ReactVersion = "18.3.0-www-modern-a95f6e9d";
2593325933

2593425934
// Might add PROFILE later.
2593525935

@@ -26833,7 +26833,10 @@ if (__DEV__) {
2683326833
createNodeMock = options.createNodeMock;
2683426834
}
2683526835

26836-
if (options.unstable_isConcurrent === true) {
26836+
if (
26837+
options.unstable_isConcurrent === true ||
26838+
options.isConcurrent === true
26839+
) {
2683726840
isConcurrent = true;
2683826841
}
2683926842

0 commit comments

Comments
 (0)