callstack / react-native-testing-library

🦉 Simple and complete React Native testing utilities that encourage good testing practices.
https://callstack.github.io/react-native-testing-library/
MIT License
3.01k stars 264 forks source link

act is deprecated #1621

Closed Ejdamm closed 3 weeks ago

Ejdamm commented 1 month ago

Describe the bug

My IDE says: The signature (callback: () => VoidOrUndefinedOnly): DebugPromiseLike of act is deprecated.

react-testing-library had the same issue https://github.com/testing-library/react-testing-library/pull/1319/files

Versions

npmPackages: @testing-library/react-native: 12.5.0 => 12.5.0 react: 18.2.0 => 18.2.0 react-native: 0.71.16 => 0.71.16 react-test-renderer: 18.3.1 => 18.3.1

mdjastrzebski commented 1 month ago

@Ejdamm for a time being you should use both react and react-test-renderer in exact version 18.2.0. Make sure you have exactly the same version of both of these packages.

Reference: https://react-native-community.github.io/upgrade-helper/?from=0.71.16&to=0.74.1

Ejdamm commented 1 month ago

Downgrading react-test-renderer to 18.2.0 didn't help but downgrading @types/react-test-renderer to 18.0.7 did the trick.

mdjastrzebski commented 1 month ago

Yeah, this is a typescript deprecation, so it makes sense.

We will support React 18.3.x & later React 19.x (react, react-test-renderer, @types/..., etc), when it's officially supported by React Native.