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 [b36ae8d7aa](https://github.com/facebook/react/commit/b36ae8d7aab94dae285d9d6a1c5f004e6fc19fc9)
This commit is contained in:
jackpope
2023-12-07 15:31:34 +00:00
parent 7adeb4a8ef
commit 0f81c6bf79
4 changed files with 12 additions and 6 deletions
+1 -1
View File
@@ -1 +1 @@
640ccebb7d9669f1efbd20e86f6f84086c3d698d
b36ae8d7aab94dae285d9d6a1c5f004e6fc19fc9
+1 -1
View File
@@ -587,4 +587,4 @@ exports.useSyncExternalStore = function (
exports.useTransition = function () {
return ReactCurrentDispatcher.current.useTransition();
};
exports.version = "18.3.0-www-classic-2869b479";
exports.version = "18.3.0-www-classic-786e33e5";
@@ -25929,7 +25929,7 @@ if (__DEV__) {
return root;
}
var ReactVersion = "18.3.0-www-classic-2869b479";
var ReactVersion = "18.3.0-www-classic-786e33e5";
// Might add PROFILE later.
@@ -26833,7 +26833,10 @@ if (__DEV__) {
createNodeMock = options.createNodeMock;
}
if (options.unstable_isConcurrent === true) {
if (
options.unstable_isConcurrent === true ||
options.isConcurrent === true
) {
isConcurrent = true;
}
@@ -25929,7 +25929,7 @@ if (__DEV__) {
return root;
}
var ReactVersion = "18.3.0-www-modern-113f1bd1";
var ReactVersion = "18.3.0-www-modern-a95f6e9d";
// Might add PROFILE later.
@@ -26833,7 +26833,10 @@ if (__DEV__) {
createNodeMock = options.createNodeMock;
}
if (options.unstable_isConcurrent === true) {
if (
options.unstable_isConcurrent === true ||
options.isConcurrent === true
) {
isConcurrent = true;
}