-
Notifications
You must be signed in to change notification settings - Fork 5.4k
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 ourterms of serviceand privacy statement.We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(sdk): resolve some React 19+ issues in our testing tools #30742
Conversation
The Pull Request introduced fingerprint changes against the base commit:1df5f45 Fingerprint diff[
{
"op":"changed",
"source":{
"type":"file",
"filePath":"../../packages/expo-font/package.json",
"reasons":[
"expoConfigPlugins"
],
"hash":"c982e5637332d396704c8353aac0431b8db4138f"
}
},
{
"op":"changed",
"source":{
"type":"dir",
"filePath":"../../packages/expo-modules-core",
"reasons":[
"expoAutolinkingIos",
"expoAutolinkingAndroid"
],
"hash":"8df1f4081d727ca64a6bab64f3d86bff89800f2c"
}
}
] Generated byPR labeler🤖 |
// The renderer is deprecated, but there is no replacement for React Native yet. | ||
// Setting this global property disables the deprecation warning, and changes RTR to legacy mode. | ||
// See: https://discord.com/channels/514829729862516747/514832743654228009/1266527040480477274 | ||
globalThis.IS_REACT_NATIVE_TEST_ENVIRONMENT = true; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
We could also define this in theexpo-module-scripts
preset, if we don't want to ship this temporary workaround to users.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Edit: I'll pull it out ofjest-expo
and intoexpo-module-scripts
,we need a user-facing solution eventually and this is just a temporary workaround.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
looks good to me for expo-sqlite changes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Looks good from the docs app side, thanks! 👍
43f0c75
to
d20b33d
Compare
…with react-native
…ry with react-native
…rary with react-native
…ry in favor of `react-native`
Co-authored-by: Expo Bot <[email protected]>
…h `@testing-library/react-native`
3ee29c4
to
969e7da
Compare
Why
There are a couple:
1. React 19 deprecates
react-test-renderer
Just the deprecation warning alone causes a few tests to fail. Unfortunately, there is no replacement yet for React Native, meaning even if we did switch to
@testing-library/react-native
,we'd still usereact-test-renderer
.2.
@testing-library/react-hooks
seems to be silently deprecated.There are no updates for React 18, or 19. For React 18, they mention to swap to
@testing-library/react
itself, and use therenderHook
function the original library. That's why I pulled out@testing-library/react-hooks
from our dependencies.3. Due to RTR being deprecated, we need to move over to
@testing-library/react-native
.Unfortunately, we'd have to wait for proper React 19 support inhttps://github.com/callstack/react-native-testing-library.Right now, it seems that
react-test-renderer
returnsnull
for a lot of renders, which also seems to indicate there are issues in the current canary version we are using.How
Unfortunately, this won't fix the current test failures fully. But it does get us on a better path towards being green again (with
react-test-renderer@19
)Test Plan
See CI
Checklist
npx expo prebuild
& EAS Build (eg: updated a module plugin).