Skip to content

Commit 7a2b412

Browse files
feat: React Native 0.80 support (#1770)
1 parent 0f5cc2e commit 7a2b412

File tree

6 files changed

+923
-919
lines changed

6 files changed

+923
-919
lines changed

eslint.config.mjs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import tseslint from 'typescript-eslint';
22
import callstackConfig from '@callstack/eslint-config/react-native.flat.js';
33
import simpleImportSort from 'eslint-plugin-simple-import-sort';
4+
import jest from 'eslint-plugin-jest';
45

56
export default [
67
{
@@ -37,6 +38,9 @@ export default [
3738
},
3839
{
3940
files: ['**/*.test.{ts,tsx}', 'src/test-utils/**'],
41+
plugins: {
42+
jest: jest,
43+
},
4044
rules: {
4145
'react/no-multi-comp': 'off',
4246
'react-native/no-color-literals': 'off',
@@ -46,6 +50,10 @@ export default [
4650
'react-native-a11y/has-valid-accessibility-ignores-invert-colors': 'off',
4751
'react-native-a11y/has-valid-accessibility-value': 'off',
4852
'@typescript-eslint/no-explicit-any': 'off',
53+
'jest/no-standalone-expect': [
54+
'error',
55+
{ additionalTestBlockFunctions: ['testGateReact19'] },
56+
],
4957
},
5058
},
5159
];

package.json

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -72,13 +72,13 @@
7272
"@babel/preset-react": "^7.25.9",
7373
"@babel/preset-typescript": "^7.26.0",
7474
"@callstack/eslint-config": "^15.0.0",
75-
"@react-native/babel-preset": "0.79.1",
75+
"@react-native/babel-preset": "0.80.1",
7676
"@release-it/conventional-changelog": "^10.0.0",
7777
"@relmify/jest-serializer-strip-ansi": "^1.0.2",
7878
"@types/jest": "^30.0.0",
7979
"@types/node": "^22.13.8",
80-
"@types/react": "^19.0.0",
81-
"@types/react-test-renderer": "^19.0.0",
80+
"@types/react": "^19.1.0",
81+
"@types/react-test-renderer": "^19.1.0",
8282
"babel-jest": "^30.0.2",
8383
"babel-plugin-module-resolver": "^5.0.2",
8484
"del-cli": "^6.0.0",
@@ -87,10 +87,10 @@
8787
"flow-bin": "~0.170.0",
8888
"jest": "^30.0.2",
8989
"prettier": "^2.8.8",
90-
"react": "19.0.0",
91-
"react-native": "0.79.1",
92-
"react-native-gesture-handler": "^2.26.0",
93-
"react-test-renderer": "19.0.0",
90+
"react": "19.1.0",
91+
"react-native": "0.80.1",
92+
"react-native-gesture-handler": "^2.27.1",
93+
"react-test-renderer": "19.1.0",
9494
"release-it": "^18.0.0",
9595
"typescript": "^5.6.3",
9696
"typescript-eslint": "^8.19.1"

src/__tests__/react-native-api.test.tsx

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@ import { FlatList, Image, Modal, ScrollView, Switch, Text, TextInput, View } fro
33

44
import { render, screen } from '..';
55

6+
const isReact19 = React.version.startsWith('19.');
7+
const testGateReact19 = isReact19 ? test : test.skip;
8+
69
/**
710
* Tests in this file are intended to give us an proactive warning that React Native behavior has
811
* changed in a way that may impact our code like queries or event handling.
@@ -214,7 +217,7 @@ test('React Native API assumption: <FlatList> renders a single host <ScrollView>
214217
`);
215218
});
216219

217-
test('React Native API assumption: <Modal> renders a single host element', () => {
220+
testGateReact19('React Native API assumption: <Modal> renders a single host element', () => {
218221
render(
219222
<Modal testID="test">
220223
<Text>Modal Content</Text>
@@ -223,9 +226,7 @@ test('React Native API assumption: <Modal> renders a single host element', () =>
223226

224227
expect(screen.toJSON()).toMatchInlineSnapshot(`
225228
<Modal
226-
hardwareAccelerated={false}
227229
testID="test"
228-
visible={true}
229230
>
230231
<Text>
231232
Modal Content

src/user-event/__tests__/__snapshots__/clear.test.tsx.snap

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Jest Snapshot v1, https://goo.gl/fbAQLP
1+
// Jest Snapshot v1, https://jestjs.io/docs/snapshot-testing
22

33
exports[`clear() supports basic case: value: "Hello! 1`] = `
44
[
@@ -274,8 +274,7 @@ exports[`clear() supports defaultValue prop: defaultValue: "Hello Default!" 1`]
274274
]
275275
`;
276276

277-
exports[`clear() supports multiline: value: "Hello World!
278-
How are you?" multiline: true, 1`] = `
277+
exports[`clear() supports multiline: value: "Hello World!\\nHow are you?" multiline: true, 1`] = `
279278
[
280279
{
281280
"name": "focus",

src/user-event/__tests__/__snapshots__/paste.test.tsx.snap

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Jest Snapshot v1, https://goo.gl/fbAQLP
1+
// Jest Snapshot v1, https://jestjs.io/docs/snapshot-testing
22

33
exports[`paste() paste on empty text input 1`] = `
44
[
@@ -360,8 +360,7 @@ exports[`paste() supports defaultValue prop: defaultValue: "Hello Default!" 1`]
360360
]
361361
`;
362362

363-
exports[`paste() supports multiline: value: "Hello World!
364-
How are you?" multiline: true, 1`] = `
363+
exports[`paste() supports multiline: value: "Hello World!\\nHow are you?" multiline: true, 1`] = `
365364
[
366365
{
367366
"name": "focus",

0 commit comments

Comments
 (0)