@@ -136,7 +136,7 @@ describe('ReactDOMRoot', () => {
it('clears existing children', async () => {
container.innerHTML = '
';
- const root = ReactDOM.createRoot(container);
+ const root = ReactDOM.unstable_createRoot(container);
root.render(
c
@@ -157,12 +157,12 @@ describe('ReactDOMRoot', () => {
it('throws a good message on invalid containers', () => {
expect(() => {
- ReactDOM.createRoot(
Hi
);
+ ReactDOM.unstable_createRoot(
Hi
);
}).toThrow('createRoot(...): Target container is not a DOM element.');
});
it('warns when rendering with legacy API into createRoot() container', () => {
- const root = ReactDOM.createRoot(container);
+ const root = ReactDOM.unstable_createRoot(container);
root.render(
Hi
);
Scheduler.unstable_flushAll();
expect(container.textContent).toEqual('Hi');
@@ -185,7 +185,7 @@ describe('ReactDOMRoot', () => {
});
it('warns when hydrating with legacy API into createRoot() container', () => {
- const root = ReactDOM.createRoot(container);
+ const root = ReactDOM.unstable_createRoot(container);
root.render(
Hi
);
Scheduler.unstable_flushAll();
expect(container.textContent).toEqual('Hi');
@@ -205,7 +205,7 @@ describe('ReactDOMRoot', () => {
});
it('warns when unmounting with legacy API (no previous content)', () => {
- const root = ReactDOM.createRoot(container);
+ const root = ReactDOM.unstable_createRoot(container);
root.render(
Hi
);
Scheduler.unstable_flushAll();
expect(container.textContent).toEqual('Hi');
@@ -234,7 +234,7 @@ describe('ReactDOMRoot', () => {
// Currently createRoot().render() doesn't clear this.
container.appendChild(document.createElement('div'));
// The rest is the same as test above.
- const root = ReactDOM.createRoot(container);
+ const root = ReactDOM.unstable_createRoot(container);
root.render(
Hi
);
Scheduler.unstable_flushAll();
expect(container.textContent).toEqual('Hi');
@@ -260,7 +260,7 @@ describe('ReactDOMRoot', () => {
it('warns when passing legacy container to createRoot()', () => {
ReactDOM.render(
Hi
, container);
expect(() => {
- ReactDOM.createRoot(container);
+ ReactDOM.unstable_createRoot(container);
}).toErrorDev(
'You are calling ReactDOM.createRoot() on a container that was previously ' +
'passed to ReactDOM.render(). This is not supported.',
@@ -269,9 +269,9 @@ describe('ReactDOMRoot', () => {
});
it('warns when creating two roots managing the same container', () => {
- ReactDOM.createRoot(container);
+ ReactDOM.unstable_createRoot(container);
expect(() => {
- ReactDOM.createRoot(container);
+ ReactDOM.unstable_createRoot(container);
}).toErrorDev(
'You are calling ReactDOM.createRoot() on a container that ' +
'has already been passed to createRoot() before. Instead, call ' +
@@ -281,15 +281,15 @@ describe('ReactDOMRoot', () => {
});
it('does not warn when creating second root after first one is unmounted', () => {
- const root = ReactDOM.createRoot(container);
+ const root = ReactDOM.unstable_createRoot(container);
root.unmount();
Scheduler.unstable_flushAll();
- ReactDOM.createRoot(container); // No warning
+ ReactDOM.unstable_createRoot(container); // No warning
});
it('warns if creating a root on the document.body', async () => {
expect(() => {
- ReactDOM.createRoot(document.body);
+ ReactDOM.unstable_createRoot(document.body);
}).toErrorDev(
'createRoot(): Creating roots directly with document.body is ' +
'discouraged, since its children are often manipulated by third-party ' +
@@ -301,7 +301,7 @@ describe('ReactDOMRoot', () => {
});
it('warns if updating a root that has had its contents removed', async () => {
- const root = ReactDOM.createRoot(container);
+ const root = ReactDOM.unstable_createRoot(container);
root.render(
Hi
);
Scheduler.unstable_flushAll();
container.innerHTML = '';
diff --git a/packages/react-dom/src/__tests__/ReactDOMServerIntegrationHooks-test.js b/packages/react-dom/src/__tests__/ReactDOMServerIntegrationHooks-test.js
index c087ec93765c8..8c90d593a74a4 100644
--- a/packages/react-dom/src/__tests__/ReactDOMServerIntegrationHooks-test.js
+++ b/packages/react-dom/src/__tests__/ReactDOMServerIntegrationHooks-test.js
@@ -1051,7 +1051,7 @@ describe('ReactDOMServerHooks', () => {
document.body.append(container);
container.innerHTML = ReactDOMServer.renderToString(
);
- const root = ReactDOM.createRoot(container, {hydrate: true});
+ const root = ReactDOM.unstable_createRoot(container, {hydrate: true});
root.render(
);
Scheduler.unstable_flushAll();
jest.runAllTimers();
@@ -1136,7 +1136,7 @@ describe('ReactDOMServerHooks', () => {
const container = document.createElement('div');
document.body.append(container);
container.innerHTML = ReactDOMServer.renderToString(
);
- const root = ReactDOM.createRoot(container, {hydrate: true});
+ const root = ReactDOM.unstable_createRoot(container, {hydrate: true});
ReactTestUtils.act(() => {
root.render(
);
});
@@ -1196,7 +1196,7 @@ describe('ReactDOMServerHooks', () => {
const container = document.createElement('div');
document.body.append(container);
container.innerHTML = ReactDOMServer.renderToString(
);
- const root = ReactDOM.createRoot(container, {hydrate: true});
+ const root = ReactDOM.unstable_createRoot(container, {hydrate: true});
ReactTestUtils.act(() => {
root.render(
);
});
@@ -1291,7 +1291,7 @@ describe('ReactDOMServerHooks', () => {
const childOneSpan = container.getElementsByTagName('span')[0];
- const root = ReactDOM.createRoot(container, {hydrate: true});
+ const root = ReactDOM.unstable_createRoot(container, {hydrate: true});
root.render(
);
expect(Scheduler).toHaveYielded([]);
@@ -1397,7 +1397,7 @@ describe('ReactDOMServerHooks', () => {
container.innerHTML = ReactDOMServer.renderToString(
);
suspend = true;
- const root = ReactDOM.createRoot(container, {hydrate: true});
+ const root = ReactDOM.unstable_createRoot(container, {hydrate: true});
await ReactTestUtils.act(async () => {
root.render(
);
});
@@ -1447,7 +1447,9 @@ describe('ReactDOMServerHooks', () => {
// This is the wrong HTML string
container.innerHTML = '
';
- ReactDOM.createRoot(container, {hydrate: true}).render(
);
+ ReactDOM.unstable_createRoot(container, {hydrate: true}).render(
+
,
+ );
expect(() =>
expect(() => Scheduler.unstable_flushAll()).toThrow(),
).toErrorDev([
@@ -1497,7 +1499,7 @@ describe('ReactDOMServerHooks', () => {
container.innerHTML = ReactDOMServer.renderToString(
);
suspend = false;
- const root = ReactDOM.createRoot(container, {hydrate: true});
+ const root = ReactDOM.unstable_createRoot(container, {hydrate: true});
await ReactTestUtils.act(async () => {
root.render(
);
});
@@ -1533,7 +1535,9 @@ describe('ReactDOMServerHooks', () => {
// This is the wrong HTML string
container.innerHTML = '
';
- ReactDOM.createRoot(container, {hydrate: true}).render(
);
+ ReactDOM.unstable_createRoot(container, {hydrate: true}).render(
+
,
+ );
expect(() =>
expect(() => Scheduler.unstable_flushAll()).toThrow(),
).toErrorDev([
@@ -1555,7 +1559,9 @@ describe('ReactDOMServerHooks', () => {
// This is the wrong HTML string
container.innerHTML = '
';
- ReactDOM.createRoot(container, {hydrate: true}).render(
);
+ ReactDOM.unstable_createRoot(container, {hydrate: true}).render(
+
,
+ );
expect(() =>
expect(() => Scheduler.unstable_flushAll()).toThrow(
'The object passed back from useOpaqueIdentifier is meant to be passed through to attributes only. ' +
@@ -1584,7 +1590,9 @@ describe('ReactDOMServerHooks', () => {
// This is the wrong HTML string
container.innerHTML = '
';
- ReactDOM.createRoot(container, {hydrate: true}).render(
);
+ ReactDOM.unstable_createRoot(container, {hydrate: true}).render(
+
,
+ );
expect(() =>
expect(() => Scheduler.unstable_flushAll()).toThrow(
'The object passed back from useOpaqueIdentifier is meant to be passed through to attributes only. ' +
@@ -1612,7 +1620,9 @@ describe('ReactDOMServerHooks', () => {
document.body.appendChild(container);
container.innerHTML = ReactDOMServer.renderToString(
);
- ReactDOM.createRoot(container, {hydrate: true}).render(
);
+ ReactDOM.unstable_createRoot(container, {hydrate: true}).render(
+
,
+ );
expect(() =>
expect(() => Scheduler.unstable_flushAll()).toThrow(
'The object passed back from useOpaqueIdentifier is meant to be passed through to attributes only. ' +
@@ -1637,7 +1647,9 @@ describe('ReactDOMServerHooks', () => {
document.body.appendChild(container);
container.innerHTML = ReactDOMServer.renderToString(
);
- ReactDOM.createRoot(container, {hydrate: true}).render(
);
+ ReactDOM.unstable_createRoot(container, {hydrate: true}).render(
+
,
+ );
expect(() =>
expect(() => Scheduler.unstable_flushAll()).toThrow(
'The object passed back from useOpaqueIdentifier is meant to be passed through to attributes only. ' +
@@ -1670,7 +1682,9 @@ describe('ReactDOMServerHooks', () => {
container.innerHTML = ReactDOMServer.renderToString(
);
- ReactDOM.createRoot(container, {hydrate: true}).render(
);
+ ReactDOM.unstable_createRoot(container, {hydrate: true}).render(
+
,
+ );
if (gate(flags => flags.new)) {
expect(() => Scheduler.unstable_flushAll()).toErrorDev([
@@ -1712,7 +1726,9 @@ describe('ReactDOMServerHooks', () => {
container.innerHTML = ReactDOMServer.renderToString(
);
- ReactDOM.createRoot(container, {hydrate: true}).render(
);
+ ReactDOM.unstable_createRoot(container, {hydrate: true}).render(
+
,
+ );
if (gate(flags => flags.new)) {
expect(() => Scheduler.unstable_flushAll()).toErrorDev([
@@ -1772,7 +1788,9 @@ describe('ReactDOMServerHooks', () => {
.getAttribute('aria-labelledby'),
).toEqual(serverID);
- ReactDOM.createRoot(container, {hydrate: true}).render(
);
+ ReactDOM.unstable_createRoot(container, {hydrate: true}).render(
+
,
+ );
jest.runAllTimers();
expect(Scheduler).toHaveYielded([]);
expect(Scheduler).toFlushAndYield([]);
diff --git a/packages/react-dom/src/__tests__/ReactServerRenderingHydration-test.js b/packages/react-dom/src/__tests__/ReactServerRenderingHydration-test.js
index 770740e591027..0ad352648c3e7 100644
--- a/packages/react-dom/src/__tests__/ReactServerRenderingHydration-test.js
+++ b/packages/react-dom/src/__tests__/ReactServerRenderingHydration-test.js
@@ -496,7 +496,7 @@ describe('ReactDOMServerHydration', () => {
const finalHTML = ReactDOMServer.renderToString(
);
const container = document.createElement('div');
container.innerHTML = finalHTML;
- const root = ReactDOM.createRoot(container, {hydrate: true});
+ const root = ReactDOM.unstable_createRoot(container, {hydrate: true});
root.render(
);
Scheduler.unstable_flushAll();
root.render(null);
diff --git a/packages/react-dom/src/__tests__/ReactTestUtilsAct-test.js b/packages/react-dom/src/__tests__/ReactTestUtilsAct-test.js
index 0629a810fc90d..8b72f084c3674 100644
--- a/packages/react-dom/src/__tests__/ReactTestUtilsAct-test.js
+++ b/packages/react-dom/src/__tests__/ReactTestUtilsAct-test.js
@@ -30,7 +30,7 @@ describe('ReactTestUtils.act()', () => {
if (__EXPERIMENTAL__) {
let concurrentRoot = null;
const renderConcurrent = (el, dom) => {
- concurrentRoot = ReactDOM.createRoot(dom);
+ concurrentRoot = ReactDOM.unstable_createRoot(dom);
concurrentRoot.render(el);
};
@@ -76,7 +76,7 @@ describe('ReactTestUtils.act()', () => {
if (__EXPERIMENTAL__) {
let blockingRoot = null;
const renderBatched = (el, dom) => {
- blockingRoot = ReactDOM.createBlockingRoot(dom);
+ blockingRoot = ReactDOM.unstable_createBlockingRoot(dom);
blockingRoot.render(el);
};
@@ -127,7 +127,9 @@ describe('ReactTestUtils.act()', () => {
// @gate experimental
it('warns in blocking mode', () => {
expect(() => {
- const root = ReactDOM.createBlockingRoot(document.createElement('div'));
+ const root = ReactDOM.unstable_createBlockingRoot(
+ document.createElement('div'),
+ );
root.render(
);
Scheduler.unstable_flushAll();
}).toErrorDev([
@@ -138,7 +140,9 @@ describe('ReactTestUtils.act()', () => {
// @gate experimental
it('warns in concurrent mode', () => {
expect(() => {
- const root = ReactDOM.createRoot(document.createElement('div'));
+ const root = ReactDOM.unstable_createRoot(
+ document.createElement('div'),
+ );
root.render(
);
Scheduler.unstable_flushAll();
}).toErrorDev([
diff --git a/packages/react-dom/src/__tests__/ReactUnmockedSchedulerWarning-test.js b/packages/react-dom/src/__tests__/ReactUnmockedSchedulerWarning-test.js
index dc59341312d66..57fc7fdcdc403 100644
--- a/packages/react-dom/src/__tests__/ReactUnmockedSchedulerWarning-test.js
+++ b/packages/react-dom/src/__tests__/ReactUnmockedSchedulerWarning-test.js
@@ -30,7 +30,7 @@ it('does not warn when rendering in legacy mode', () => {
// @gate experimental
it('should warn when rendering in concurrent mode', () => {
expect(() => {
- ReactDOM.createRoot(document.createElement('div')).render(
);
+ ReactDOM.unstable_createRoot(document.createElement('div')).render(
);
}).toErrorDev(
'In Concurrent or Sync modes, the "scheduler" module needs to be mocked ' +
'to guarantee consistent behaviour across tests and browsers.',
@@ -38,14 +38,16 @@ it('should warn when rendering in concurrent mode', () => {
);
// does not warn twice
expect(() => {
- ReactDOM.createRoot(document.createElement('div')).render(
);
+ ReactDOM.unstable_createRoot(document.createElement('div')).render(
);
}).toErrorDev([]);
});
// @gate experimental
it('should warn when rendering in blocking mode', () => {
expect(() => {
- ReactDOM.createBlockingRoot(document.createElement('div')).render(
);
+ ReactDOM.unstable_createBlockingRoot(document.createElement('div')).render(
+
,
+ );
}).toErrorDev(
'In Concurrent or Sync modes, the "scheduler" module needs to be mocked ' +
'to guarantee consistent behaviour across tests and browsers.',
@@ -53,6 +55,8 @@ it('should warn when rendering in blocking mode', () => {
);
// does not warn twice
expect(() => {
- ReactDOM.createBlockingRoot(document.createElement('div')).render(
);
+ ReactDOM.unstable_createBlockingRoot(document.createElement('div')).render(
+
,
+ );
}).toErrorDev([]);
});
diff --git a/packages/react-dom/src/__tests__/ReactUpdates-test.js b/packages/react-dom/src/__tests__/ReactUpdates-test.js
index 9fc50d0f34b4e..7b4af4f928ab9 100644
--- a/packages/react-dom/src/__tests__/ReactUpdates-test.js
+++ b/packages/react-dom/src/__tests__/ReactUpdates-test.js
@@ -1319,7 +1319,7 @@ describe('ReactUpdates', () => {
);
}
- const root = ReactDOM.createRoot(container);
+ const root = ReactDOM.unstable_createRoot(container);
let hiddenDiv;
act(() => {
root.render(
);
diff --git a/packages/react-dom/src/events/plugins/__tests__/LegacyChangeEventPlugin-test.js b/packages/react-dom/src/events/plugins/__tests__/LegacyChangeEventPlugin-test.js
index c83cfc4548970..5c81747996b1a 100644
--- a/packages/react-dom/src/events/plugins/__tests__/LegacyChangeEventPlugin-test.js
+++ b/packages/react-dom/src/events/plugins/__tests__/LegacyChangeEventPlugin-test.js
@@ -479,7 +479,7 @@ describe('ChangeEventPlugin', () => {
// @gate experimental
it('text input', () => {
- const root = ReactDOM.createRoot(container);
+ const root = ReactDOM.unstable_createRoot(container);
let input;
class ControlledInput extends React.Component {
@@ -522,7 +522,7 @@ describe('ChangeEventPlugin', () => {
// @gate experimental
it('checkbox input', () => {
- const root = ReactDOM.createRoot(container);
+ const root = ReactDOM.unstable_createRoot(container);
let input;
class ControlledInput extends React.Component {
@@ -578,7 +578,7 @@ describe('ChangeEventPlugin', () => {
// @gate experimental
it('textarea', () => {
- const root = ReactDOM.createRoot(container);
+ const root = ReactDOM.unstable_createRoot(container);
let textarea;
class ControlledTextarea extends React.Component {
@@ -621,7 +621,7 @@ describe('ChangeEventPlugin', () => {
// @gate experimental
it('parent of input', () => {
- const root = ReactDOM.createRoot(container);
+ const root = ReactDOM.unstable_createRoot(container);
let input;
class ControlledInput extends React.Component {
@@ -668,7 +668,7 @@ describe('ChangeEventPlugin', () => {
// @gate experimental
it('is async for non-input events', () => {
- const root = ReactDOM.createRoot(container);
+ const root = ReactDOM.unstable_createRoot(container);
let input;
class ControlledInput extends React.Component {
@@ -728,7 +728,7 @@ describe('ChangeEventPlugin', () => {
const {act} = TestUtils;
const {useState} = React;
- const root = ReactDOM.createRoot(container);
+ const root = ReactDOM.unstable_createRoot(container);
const target = React.createRef(null);
function Foo() {
diff --git a/packages/react-dom/src/events/plugins/__tests__/LegacySimpleEventPlugin-test.js b/packages/react-dom/src/events/plugins/__tests__/LegacySimpleEventPlugin-test.js
index f015689703255..bcf5e12e09861 100644
--- a/packages/react-dom/src/events/plugins/__tests__/LegacySimpleEventPlugin-test.js
+++ b/packages/react-dom/src/events/plugins/__tests__/LegacySimpleEventPlugin-test.js
@@ -239,7 +239,7 @@ describe('SimpleEventPlugin', function() {
// @gate experimental
it('flushes pending interactive work before extracting event handler', () => {
container = document.createElement('div');
- const root = ReactDOM.createRoot(container);
+ const root = ReactDOM.unstable_createRoot(container);
document.body.appendChild(container);
let button;
@@ -310,7 +310,7 @@ describe('SimpleEventPlugin', function() {
// @gate experimental
it('end result of many interactive updates is deterministic', () => {
container = document.createElement('div');
- const root = ReactDOM.createRoot(container);
+ const root = ReactDOM.unstable_createRoot(container);
document.body.appendChild(container);
let button;
@@ -409,7 +409,7 @@ describe('SimpleEventPlugin', function() {
}
// Initial mount
- const root = ReactDOM.createRoot(container);
+ const root = ReactDOM.unstable_createRoot(container);
root.render(
);
expect(Scheduler).toFlushAndYield([
'High-pri count: 0, Low-pri count: 0',
diff --git a/packages/react-reconciler/src/__tests__/ReactBlocks-test.js b/packages/react-reconciler/src/__tests__/ReactBlocks-test.js
index 56be938649584..06662e63f3ebd 100644
--- a/packages/react-reconciler/src/__tests__/ReactBlocks-test.js
+++ b/packages/react-reconciler/src/__tests__/ReactBlocks-test.js
@@ -24,7 +24,7 @@ describe('ReactBlocks', () => {
React = require('react');
ReactNoop = require('react-noop-renderer');
- block = React.block;
+ block = React.unstable_block;
useState = React.useState;
Suspense = React.Suspense;
const cache = new Map();
diff --git a/packages/react-reconciler/src/__tests__/ReactHooksWithNoopRenderer-test.js b/packages/react-reconciler/src/__tests__/ReactHooksWithNoopRenderer-test.js
index 5dff2fde2c055..5e34e346466fc 100644
--- a/packages/react-reconciler/src/__tests__/ReactHooksWithNoopRenderer-test.js
+++ b/packages/react-reconciler/src/__tests__/ReactHooksWithNoopRenderer-test.js
@@ -63,8 +63,8 @@ describe('ReactHooksWithNoopRenderer', () => {
useImperativeHandle = React.useImperativeHandle;
forwardRef = React.forwardRef;
memo = React.memo;
- useTransition = React.useTransition;
- useDeferredValue = React.useDeferredValue;
+ useTransition = React.unstable_useTransition;
+ useDeferredValue = React.unstable_useDeferredValue;
Suspense = React.Suspense;
act = ReactNoop.act;
diff --git a/packages/react-reconciler/src/__tests__/ReactSuspenseList-test.js b/packages/react-reconciler/src/__tests__/ReactSuspenseList-test.js
index 19cea8e172c92..4df09b53707ee 100644
--- a/packages/react-reconciler/src/__tests__/ReactSuspenseList-test.js
+++ b/packages/react-reconciler/src/__tests__/ReactSuspenseList-test.js
@@ -12,7 +12,7 @@ describe('ReactSuspenseList', () => {
ReactNoop = require('react-noop-renderer');
Scheduler = require('scheduler');
Suspense = React.Suspense;
- SuspenseList = React.SuspenseList;
+ SuspenseList = React.unstable_SuspenseList;
});
function Text(props) {
diff --git a/packages/react-reconciler/src/__tests__/ReactSuspenseWithNoopRenderer-test.js b/packages/react-reconciler/src/__tests__/ReactSuspenseWithNoopRenderer-test.js
index bf1f1a696ea2f..f27ec62ff84e8 100644
--- a/packages/react-reconciler/src/__tests__/ReactSuspenseWithNoopRenderer-test.js
+++ b/packages/react-reconciler/src/__tests__/ReactSuspenseWithNoopRenderer-test.js
@@ -2737,7 +2737,9 @@ describe('ReactSuspenseWithNoopRenderer', () => {
function App() {
const [page, setPage] = React.useState('A');
- const [startLoading, isLoading] = React.useTransition(SUSPENSE_CONFIG);
+ const [startLoading, isLoading] = React.unstable_useTransition(
+ SUSPENSE_CONFIG,
+ );
transitionToPage = nextPage => startLoading(() => setPage(nextPage));
return (
@@ -3718,7 +3720,7 @@ describe('ReactSuspenseWithNoopRenderer', () => {
// @gate experimental
it('regression: ping at high priority causes update to be dropped', async () => {
- const {useState, useTransition} = React;
+ const {useState, unstable_useTransition: useTransition} = React;
let setTextA;
function A() {
@@ -3836,10 +3838,10 @@ describe('ReactSuspenseWithNoopRenderer', () => {
let setTextWithLongTransition;
function App() {
- const [startShortTransition, isPending1] = React.useTransition({
+ const [startShortTransition, isPending1] = React.unstable_useTransition({
timeoutMs: 5000,
});
- const [startLongTransition, isPending2] = React.useTransition({
+ const [startLongTransition, isPending2] = React.unstable_useTransition({
timeoutMs: 30000,
});
const isPending = isPending1 || isPending2;
diff --git a/packages/react-reconciler/src/__tests__/ReactTransition-test.js b/packages/react-reconciler/src/__tests__/ReactTransition-test.js
index 3970fcaaf2f37..1b25cf7dd1879 100644
--- a/packages/react-reconciler/src/__tests__/ReactTransition-test.js
+++ b/packages/react-reconciler/src/__tests__/ReactTransition-test.js
@@ -25,7 +25,7 @@ describe('ReactTransition', () => {
ReactNoop = require('react-noop-renderer');
Scheduler = require('scheduler');
useState = React.useState;
- useTransition = React.useTransition;
+ useTransition = React.unstable_useTransition;
Suspense = React.Suspense;
act = ReactNoop.act;
});
diff --git a/packages/react-refresh/src/__tests__/ReactFresh-test.js b/packages/react-refresh/src/__tests__/ReactFresh-test.js
index 268bf4d111262..e24ec52c92404 100644
--- a/packages/react-refresh/src/__tests__/ReactFresh-test.js
+++ b/packages/react-refresh/src/__tests__/ReactFresh-test.js
@@ -2424,7 +2424,7 @@ describe('ReactFresh', () => {
};
});
- const root = ReactDOM.createRoot(container);
+ const root = ReactDOM.unstable_createRoot(container);
root.render();
expect(Scheduler).toFlushAndYieldThrough(['App#layout']);
const el = container.firstChild;
diff --git a/packages/react-transport-dom-webpack/src/__tests__/ReactFlightDOM-test.js b/packages/react-transport-dom-webpack/src/__tests__/ReactFlightDOM-test.js
index 46f424409c886..72aa615260f27 100644
--- a/packages/react-transport-dom-webpack/src/__tests__/ReactFlightDOM-test.js
+++ b/packages/react-transport-dom-webpack/src/__tests__/ReactFlightDOM-test.js
@@ -183,7 +183,7 @@ describe('ReactFlightDOM', () => {
const response = ReactTransportDOMClient.createFromReadableStream(readable);
const container = document.createElement('div');
- const root = ReactDOM.createRoot(container);
+ const root = ReactDOM.unstable_createRoot(container);
await act(async () => {
root.render();
});
@@ -222,7 +222,7 @@ describe('ReactFlightDOM', () => {
const response = ReactTransportDOMClient.createFromReadableStream(readable);
const container = document.createElement('div');
- const root = ReactDOM.createRoot(container);
+ const root = ReactDOM.unstable_createRoot(container);
await act(async () => {
root.render();
});
@@ -259,7 +259,7 @@ describe('ReactFlightDOM', () => {
const response = ReactTransportDOMClient.createFromReadableStream(readable);
const container = document.createElement('div');
- const root = ReactDOM.createRoot(container);
+ const root = ReactDOM.unstable_createRoot(container);
await act(async () => {
root.render();
});
@@ -418,7 +418,7 @@ describe('ReactFlightDOM', () => {
const response = ReactTransportDOMClient.createFromReadableStream(readable);
const container = document.createElement('div');
- const root = ReactDOM.createRoot(container);
+ const root = ReactDOM.unstable_createRoot(container);
await act(async () => {
root.render();
});
diff --git a/packages/react/index.classic.fb.js b/packages/react/index.classic.fb.js
index 9c94c49fb21c9..96f4791d4ff65 100644
--- a/packages/react/index.classic.fb.js
+++ b/packages/react/index.classic.fb.js
@@ -40,11 +40,15 @@ export {
createFactory,
// exposeConcurrentModeAPIs
useTransition,
+ useTransition as unstable_useTransition,
useDeferredValue,
+ useDeferredValue as unstable_useDeferredValue,
SuspenseList,
+ SuspenseList as unstable_SuspenseList,
unstable_withSuspenseConfig,
// enableBlocksAPI
block,
+ block as unstable_block,
// enableDeprecatedFlareAPI
DEPRECATED_useResponder,
DEPRECATED_createResponder,
diff --git a/packages/react/index.experimental.js b/packages/react/index.experimental.js
index c2cb40a815744..47f8a1b0e6bc5 100644
--- a/packages/react/index.experimental.js
+++ b/packages/react/index.experimental.js
@@ -39,12 +39,12 @@ export {
__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,
createFactory,
// exposeConcurrentModeAPIs
- useTransition,
- useDeferredValue,
- SuspenseList,
+ useTransition as unstable_useTransition,
+ useDeferredValue as unstable_useDeferredValue,
+ SuspenseList as unstable_SuspenseList,
unstable_withSuspenseConfig,
// enableBlocksAPI
- block,
+ block as unstable_block,
unstable_useOpaqueIdentifier,
// enableDebugTracing
unstable_DebugTracingMode,
diff --git a/packages/react/index.js b/packages/react/index.js
index d3fa1b145ff45..4cd2d761fb6a2 100644
--- a/packages/react/index.js
+++ b/packages/react/index.js
@@ -69,10 +69,14 @@ export {
__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,
createFactory,
useTransition,
+ useTransition as unstable_useTransition,
useDeferredValue,
+ useDeferredValue as unstable_useDeferredValue,
SuspenseList,
+ SuspenseList as unstable_SuspenseList,
unstable_withSuspenseConfig,
block,
+ block as unstable_block,
DEPRECATED_useResponder,
DEPRECATED_createResponder,
unstable_createFundamental,
diff --git a/packages/react/index.modern.fb.js b/packages/react/index.modern.fb.js
index a162ef330662c..b039b25ef4363 100644
--- a/packages/react/index.modern.fb.js
+++ b/packages/react/index.modern.fb.js
@@ -39,11 +39,15 @@ export {
__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,
// exposeConcurrentModeAPIs
useTransition,
+ useTransition as unstable_useTransition,
useDeferredValue,
+ useDeferredValue as unstable_useDeferredValue,
SuspenseList,
+ SuspenseList as unstable_SuspenseList,
unstable_withSuspenseConfig,
// enableBlocksAPI
block,
+ block as unstable_block,
// enableDeprecatedFlareAPI
DEPRECATED_useResponder,
DEPRECATED_createResponder,
diff --git a/packages/react/src/__tests__/ReactStrictMode-test.js b/packages/react/src/__tests__/ReactStrictMode-test.js
index a9eecf61277c8..55e473f2b60fd 100644
--- a/packages/react/src/__tests__/ReactStrictMode-test.js
+++ b/packages/react/src/__tests__/ReactStrictMode-test.js
@@ -398,7 +398,7 @@ describe('Concurrent Mode', () => {
}
const container = document.createElement('div');
- const root = ReactDOM.createRoot(container);
+ const root = ReactDOM.unstable_createRoot(container);
root.render();
expect(() => Scheduler.unstable_flushAll()).toErrorDev(
[
@@ -454,7 +454,7 @@ Please update the following components: AsyncRoot`,
}
const container = document.createElement('div');
- const root = ReactDOM.createRoot(container);
+ const root = ReactDOM.unstable_createRoot(container);
root.render();
expect(() => {
@@ -533,7 +533,7 @@ Please update the following components: Parent`,
}
const container = document.createElement('div');
- const root = ReactDOM.createRoot(container);
+ const root = ReactDOM.unstable_createRoot(container);
root.render();
expect(() =>
Scheduler.unstable_flushAll(),