Skip to content

Commit 330290e

Browse files
committed
Cleanup fixture code
1 parent a76db41 commit 330290e

25 files changed

+52
-73
lines changed

fixture/react-native/src/Carousel.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import {
77
TouchableOpacity,
88
useWindowDimensions,
99
} from "react-native";
10-
import { FlashListRef, RecyclerView } from "@shopify/flash-list";
10+
import { FlashListRef, FlashList } from "@shopify/flash-list";
1111

1212
interface CarouselItem {
1313
id: string;
@@ -139,7 +139,7 @@ const Carousel = () => {
139139
return (
140140
<View style={styles.container}>
141141
<Text style={styles.headerTitle}>Simple Carousel</Text>
142-
<RecyclerView
142+
<FlashList
143143
testID="CarouselScreen"
144144
style={{ flex: 1 }}
145145
ref={flatListRef}

fixture/react-native/src/CellRendererExamples.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import React, { useEffect, useRef, useCallback } from "react";
22
import { View, Text, StyleSheet, Animated } from "react-native";
3-
import { RecyclerView } from "@shopify/flash-list";
3+
import { FlashList } from "@shopify/flash-list";
44

55
import { tweets as tweetsData } from "./twitter/data/tweets";
66
import Tweet from "./twitter/models/Tweet";
@@ -77,7 +77,7 @@ const FlashListCellRenderer = () => {
7777
<View style={styles.container}>
7878
<Text style={styles.title}>Fade-In Animation</Text>
7979
<View style={{ flex: 1 }}>
80-
<RecyclerView
80+
<FlashList
8181
data={tweetsData}
8282
renderItem={renderTweet}
8383
CellRendererComponent={FadeInCellRenderer}
@@ -89,7 +89,7 @@ const FlashListCellRenderer = () => {
8989
<View style={styles.container}>
9090
<Text style={styles.title}>Scale Animation</Text>
9191
<View style={{ flex: 1 }}>
92-
<RecyclerView
92+
<FlashList
9393
data={tweetsData}
9494
renderItem={renderTweet}
9595
CellRendererComponent={ScaleCellRenderer}

fixture/react-native/src/Chat.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import {
77
SafeAreaView,
88
StatusBar,
99
} from "react-native";
10-
import { RecyclerView } from "@shopify/flash-list";
10+
import { FlashList } from "@shopify/flash-list";
1111

1212
interface ChatMessage {
1313
id: string;
@@ -94,7 +94,7 @@ export function Chat() {
9494
</Pressable>
9595
</View>
9696

97-
<RecyclerView
97+
<FlashList
9898
data={messages}
9999
maintainVisibleContentPosition={maintainVisibleContentPositionConfig}
100100
onStartReached={() => {

fixture/react-native/src/ComplexMasonry.tsx

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import {
77
TouchableOpacity,
88
ActivityIndicator,
99
} from "react-native";
10-
import { FlashListRef, RecyclerView } from "@shopify/flash-list";
10+
import { FlashListRef, FlashList } from "@shopify/flash-list";
1111
import FastImage from "@d11/react-native-fast-image";
1212

1313
// Define our data structure
@@ -181,14 +181,13 @@ const ComplexMasonryComponent = (_: unknown, ref: ForwardedRef<unknown>) => {
181181

182182
return (
183183
<View style={styles.container}>
184-
<RecyclerView
184+
<FlashList
185185
ref={ref as React.RefObject<FlashListRef<MasonryItem>>}
186186
testID="ComplexMasonryList"
187187
data={items}
188188
masonry
189189
optimizeItemArrangement
190190
numColumns={columnCount}
191-
estimatedItemSize={200}
192191
overrideItemLayout={(layout: any, item: MasonryItem) => {
193192
// Set the height based on the item's height property and expansion state
194193
layout.size = item.isExpanded ? item.height * 1.5 : item.height;

fixture/react-native/src/Debug/DebugScreen.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ const DebugScreen = () => {
2626
return item.name;
2727
}}
2828
renderItem={renderItem}
29-
estimatedItemSize={44}
3029
ItemSeparatorComponent={Divider}
3130
data={debugItems}
3231
/>

fixture/react-native/src/DynamicColumnSpan.tsx

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import React, { useMemo, useState, useCallback } from "react";
22
import { Text, View, StyleSheet, Platform, Pressable } from "react-native";
3-
import { RecyclerView, useRecyclingState } from "@shopify/flash-list";
3+
import { FlashList, useRecyclingState } from "@shopify/flash-list";
44

55
interface DynamicItem {
66
id: number;
@@ -208,7 +208,7 @@ export function DynamicColumnSpan() {
208208
</View>
209209

210210
{/* List */}
211-
<RecyclerView
211+
<FlashList
212212
testID="DynamicColumnSpanList"
213213
data={data}
214214
numColumns={numColumns}
@@ -217,7 +217,6 @@ export function DynamicColumnSpan() {
217217
overrideItemLayout={overrideItemLayout}
218218
renderItem={renderItem}
219219
keyExtractor={keyExtractor}
220-
estimatedItemSize={isMasonry ? 100 : 80}
221220
/>
222221
</View>
223222
</React.StrictMode>

fixture/react-native/src/DynamicItems.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import React, { useEffect, useState, useCallback } from "react";
22
import { View, Text, StyleSheet, Pressable } from "react-native";
3-
import { RecyclerView } from "@shopify/flash-list";
3+
import { FlashList } from "@shopify/flash-list";
44

55
interface Item {
66
id: string;
@@ -77,7 +77,7 @@ const DynamicItems = () => {
7777
<Text style={styles.buttonText}>Add 5 Items</Text>
7878
</Pressable>
7979
</View>
80-
<RecyclerView
80+
<FlashList
8181
data={items}
8282
renderItem={renderItem}
8383
keyExtractor={keyExtractor}

fixture/react-native/src/Grid.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import React, { useMemo, useState, useCallback } from "react";
22
import { Text, View, StyleSheet, Platform, Pressable } from "react-native";
3-
import { RecyclerView, useRecyclingState } from "@shopify/flash-list";
3+
import { FlashList, useRecyclingState } from "@shopify/flash-list";
44

55
interface GridItem {
66
id: number;
@@ -70,7 +70,7 @@ export function Grid() {
7070
return (
7171
<React.StrictMode>
7272
<View style={styles.container}>
73-
<RecyclerView
73+
<FlashList
7474
testID="GridScreen"
7575
data={data}
7676
numColumns={2}

fixture/react-native/src/HeaderFooterExample.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import React, { useState, useCallback, useMemo } from "react";
22
import { View, Text, StyleSheet, TouchableOpacity } from "react-native";
3-
import { RecyclerView } from "@shopify/flash-list";
3+
import { FlashList } from "@shopify/flash-list";
44

55
interface ListItem {
66
id: string;
@@ -70,7 +70,7 @@ export const HeaderFooterExample = () => {
7070

7171
return (
7272
<View style={styles.container}>
73-
<RecyclerView
73+
<FlashList
7474
data={data}
7575
onLoad={handleLoad}
7676
renderItem={renderItem}

fixture/react-native/src/HorizontalList.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import React, { useState, useCallback } from "react";
22
import { View, Text, StyleSheet, Pressable, StatusBar } from "react-native";
3-
import { RecyclerView, useRecyclingState } from "@shopify/flash-list";
3+
import { FlashList, useRecyclingState } from "@shopify/flash-list";
44

55
interface Item {
66
id: number;
@@ -83,7 +83,7 @@ const HorizontalList = () => {
8383
<View style={styles.container}>
8484
<StatusBar barStyle="dark-content" />
8585
<Text style={styles.header}>Horizontal List Example</Text>
86-
<RecyclerView
86+
<FlashList
8787
testID="HorizontalListScreen"
8888
horizontal
8989
data={data}

0 commit comments

Comments
 (0)