From f1338f8080abd1386454a10bbf93d67bfe37ce85 Mon Sep 17 00:00:00 2001 From: Rick Hanlon Date: Thu, 25 Apr 2024 18:50:50 -0400 Subject: [PATCH] Export `React.act` from 18.3 --- .../react-reconciler/src/__tests__/ReactIsomorphicAct-test.js | 2 +- packages/react/index.classic.fb.js | 1 + packages/react/index.experimental.js | 1 + packages/react/index.js | 1 + packages/react/index.modern.fb.js | 1 + packages/react/index.stable.js | 1 + 6 files changed, 6 insertions(+), 1 deletion(-) diff --git a/packages/react-reconciler/src/__tests__/ReactIsomorphicAct-test.js b/packages/react-reconciler/src/__tests__/ReactIsomorphicAct-test.js index 78458bd2d5bfd..2cd660952e249 100644 --- a/packages/react-reconciler/src/__tests__/ReactIsomorphicAct-test.js +++ b/packages/react-reconciler/src/__tests__/ReactIsomorphicAct-test.js @@ -20,7 +20,7 @@ describe('isomorphic act()', () => { ReactNoop = require('react-noop-renderer'); DiscreteEventPriority = require('react-reconciler/constants') .DiscreteEventPriority; - act = React.unstable_act; + act = gate(flags => flags.variant) ? React.act : React.unstable_act; }); beforeEach(() => { diff --git a/packages/react/index.classic.fb.js b/packages/react/index.classic.fb.js index 76326a0fe59d0..7a74be22193f6 100644 --- a/packages/react/index.classic.fb.js +++ b/packages/react/index.classic.fb.js @@ -9,6 +9,7 @@ export { __SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED, + act, act as unstable_act, Children, Component, diff --git a/packages/react/index.experimental.js b/packages/react/index.experimental.js index 287c137298815..ae226b5401b17 100644 --- a/packages/react/index.experimental.js +++ b/packages/react/index.experimental.js @@ -9,6 +9,7 @@ export { __SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED, + act, act as unstable_act, Children, Component, diff --git a/packages/react/index.js b/packages/react/index.js index 084aabb53c6bf..f9da4af058a74 100644 --- a/packages/react/index.js +++ b/packages/react/index.js @@ -33,6 +33,7 @@ export type ChildrenArray<+T> = $ReadOnlyArray> | T; // We can't use export * from in Flow for some reason. export { __SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED, + act, act as unstable_act, Children, Component, diff --git a/packages/react/index.modern.fb.js b/packages/react/index.modern.fb.js index e9f80ade06105..a97abadbd6bee 100644 --- a/packages/react/index.modern.fb.js +++ b/packages/react/index.modern.fb.js @@ -9,6 +9,7 @@ export { __SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED, + act, act as unstable_act, Children, Component, diff --git a/packages/react/index.stable.js b/packages/react/index.stable.js index 3ed868197b6f8..ced6043e23be0 100644 --- a/packages/react/index.stable.js +++ b/packages/react/index.stable.js @@ -9,6 +9,7 @@ export { __SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED, + act, act as unstable_act, Children, Component,