Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug: global.IS_REACT_ACT_ENVIRONMENT = false does not work #24854

Closed
anilanar opened this issue Jul 5, 2022 · 1 comment
Closed

Bug: global.IS_REACT_ACT_ENVIRONMENT = false does not work #24854

anilanar opened this issue Jul 5, 2022 · 1 comment
Labels
Resolution: Support Redirect Status: Unconfirmed A potential issue that we haven't yet confirmed as a bug

Comments

@anilanar
Copy link

anilanar commented Jul 5, 2022

Potentially related to using jest. Didn't confirm.

React version: 18.2.0

Steps To Reproduce

  1. 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.
  2. npm install
  3. 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.

@anilanar anilanar added the Status: Unconfirmed A potential issue that we haven't yet confirmed as a bug label Jul 5, 2022
@eps1lon
Copy link
Collaborator

eps1lon commented Jul 5, 2022

@testing-library/react automatically sets it. I haven't really thought about how you would use @testing-library/react without relying on act.

Though you should file this in https://github.com/testing-library/react-testing-library/ instead since React can't do anything here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Resolution: Support Redirect Status: Unconfirmed A potential issue that we haven't yet confirmed as a bug
Projects
None yet
Development

No branches or pull requests

2 participants