Closed christopherschroer closed 7 months ago
This is a bug in react 18.3 https://github.com/facebook/react/issues/28915
Act change is already implemented in testing library https://github.com/testing-library/react-testing-library/blob/48282c2f35fb7338834b40983c12b889af35f5d1/src/act-compat.js#L5
Thanks for reporting this. I'm closing in favor of https://github.com/facebook/react/issues/28915 as we already implemented this as @ambar-arkin mentioned.
Describe the feature you'd like:
I would like react-testing-library to support the newly released React 18.3. According to react.dev:
Suggested implementation:
React.dev provides an upgrade guide for React 19 Beta here. I would suggest reviewing it and implementing applicable changes as part of supporting React 18.3/19.
One of the changes that is causing warnings to be logged concerns the
act
functionhttps://react.dev/blog/2024/04/25/react-19-upgrade-guide#removed-react-dom-test-utils
Describe alternatives you've considered:
Not upgrading to React 18.3 yet in order to keep test logs clean
Teachability, Documentation, Adoption, Migration Strategy:
Following the above upgrade guide as needed