Skip to content

Commit 9075365

Browse files
author
pierrezimmermann
committed
fix: flatlist not rendering in rntl repo
1 parent 4a8072d commit 9075365

File tree

5 files changed

+16
-6
lines changed

5 files changed

+16
-6
lines changed

babel.config.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ module.exports = {
1212
},
1313
],
1414
],
15-
plugins: ['@babel/plugin-proposal-class-properties'],
1615
env: {
1716
test: {
1817
// https://github.com/react-native-community/upgrade-support/issues/152

package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@
3434
"devDependencies": {
3535
"@babel/cli": "^7.19.3",
3636
"@babel/core": "^7.20.2",
37-
"@babel/plugin-proposal-class-properties": "^7.18.6",
3837
"@babel/plugin-transform-flow-strip-types": "^7.19.0",
3938
"@babel/preset-env": "^7.20.2",
4039
"@babel/preset-flow": "^7.18.6",

src/__tests__/__snapshots__/render-debug.test.tsx.snap

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -393,7 +393,7 @@ exports[`debug: shallow 1`] = `
393393
value=""
394394
/>
395395
<MyButton
396-
onPress={[Function anonymous]}
396+
onPress={[Function changeFresh]}
397397
type="primary"
398398
>
399399
Change freshness!
@@ -445,7 +445,7 @@ exports[`debug: shallow with message 1`] = `
445445
value=""
446446
/>
447447
<MyButton
448-
onPress={[Function anonymous]}
448+
onPress={[Function changeFresh]}
449449
type="primary"
450450
>
451451
Change freshness!

src/__tests__/render.test.tsx

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/* eslint-disable no-console */
22
import * as React from 'react';
3-
import { View, Text, TextInput, Pressable } from 'react-native';
3+
import { View, Text, TextInput, Pressable, FlatList } from 'react-native';
44
import { getConfig, resetToDefaults } from '../config';
55
import { render, screen, fireEvent, RenderAPI } from '..';
66

@@ -254,3 +254,15 @@ test('render calls detects host component names', () => {
254254
render(<View testID="test" />);
255255
expect(getConfig().hostComponentNames).not.toBeUndefined();
256256
});
257+
258+
test('render FlatList', () => {
259+
const screen = render(
260+
<FlatList
261+
testID="flatList"
262+
data={[1, 2, 3]}
263+
renderItem={({ item }) => <Text>{item}</Text>}
264+
/>
265+
);
266+
267+
expect(screen.getByTestId('flatList')).toBeTruthy();
268+
});

yarn.lock

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -312,7 +312,7 @@
312312
"@babel/helper-remap-async-to-generator" "^7.18.9"
313313
"@babel/plugin-syntax-async-generators" "^7.8.4"
314314

315-
"@babel/plugin-proposal-class-properties@^7.0.0", "@babel/plugin-proposal-class-properties@^7.13.0", "@babel/plugin-proposal-class-properties@^7.18.6":
315+
"@babel/plugin-proposal-class-properties@^7.0.0", "@babel/plugin-proposal-class-properties@^7.13.0":
316316
version "7.18.6"
317317
resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-class-properties/-/plugin-proposal-class-properties-7.18.6.tgz#b110f59741895f7ec21a6fff696ec46265c446a3"
318318
integrity sha512-cumfXOF0+nzZrrN8Rf0t7M+tF6sZc7vhQwYQck9q1/5w2OExlD+b4v4RpMJFaV1Z7WcDRgO6FqvxqxGlwo+RHQ==

0 commit comments

Comments
 (0)