Closed
Description
In the newly released 18.3.0 release, if you try to use the act
function from react-dom/test-utils
, you will get the following warning:
Import
act
fromreact
instead ofreact-dom/test-utils
However, the 18.3.0 release only ships unstable_act
, not act
. The react 19 beta seems to have renamed to act
.
I feel the warning should either tell you to import from unstable_act
, or the act
export should actually exist, even if aliased to unstable_act
internally
React version: 18.3.0
Steps To Reproduce
- On react + react-dom@18.3.0, import and use
act
fromreact-dom/test-utils
. - See warning
- Try to import
act
from react@18.3.0
Link to code example: https://codesandbox.io/p/sandbox/intelligent-chandrasekhar-p9xk7h
The current behavior
act
does not exist, warning tells you to use it
The expected behavior
act
exists, warning tells you to use it OR warning tells you to use unstable_act