Potentially related to using jest. Didn't confirm.
React version: 18.2.0
Steps To Reproduce
- Clone https://github.com/anilanar/react-18-act-env ; which is a
create-react-app with an adjustment to App component to trigger an async setState and an adjustment to the test to wait for that async state update.
npm install
npm test -- --watchAll
The current behavior
It logs Warning: An update to App inside a test was not wrapped in act(...).
The expected behavior
It does not log that warning.