Skip to content

Commit 1aaff36

Browse files
committed
temporarily ignore fixture ts errors
1 parent 35b33e1 commit 1aaff36

15 files changed

+29
-36
lines changed

fixture/react-native/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@
5151
"pixelmatch": "^5.3.0",
5252
"pngjs": "^7.0.0",
5353
"postinstall-postinstall": "^2.1.0",
54-
"typescript": "4.8.4"
54+
"typescript": "5.8.3"
5555
},
5656
"jest": {
5757
"preset": "react-native"

fixture/react-native/src/Carousel.tsx

+2-3
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,13 @@
1-
import React, { useCallback, useLayoutEffect, useRef, useState } from "react";
1+
import React, { useCallback, useRef } from "react";
22
import {
33
View,
44
Text,
55
StyleSheet,
6-
Dimensions,
76
Image,
87
TouchableOpacity,
98
useWindowDimensions,
109
} from "react-native";
11-
import { RecyclerView, useLayoutState } from "@shopify/flash-list";
10+
import { RecyclerView } from "@shopify/flash-list";
1211

1312
interface CarouselItem {
1413
id: string;

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

+1
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ const DebugScreen = () => {
2020
};
2121

2222
return (
23+
// @ts-ignore - Type compatibility issue between different React versions
2324
<FlashList
2425
keyExtractor={(item: DebugItem) => {
2526
return item.name;

fixture/react-native/src/DynamicItems.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import React, { useEffect, useState, useCallback, useMemo } from "react";
1+
import React, { useEffect, useState, useCallback } from "react";
22
import { View, Text, StyleSheet, Pressable } from "react-native";
33
import { RecyclerView } from "@shopify/flash-list";
44

@@ -10,7 +10,7 @@ interface Item {
1010
let id = 0;
1111

1212
const ItemRenderer = ({ item }: { item: Item }) => {
13-
const [id, setId] = useState(item.id);
13+
const id = item.id;
1414
// log mount and unmount
1515
useEffect(() => {
1616
console.log("ItemRenderer mounted");

fixture/react-native/src/Messages/Messages.tsx

+1
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ const Messages = () => {
2828
keyboardVerticalOffset={100}
2929
style={styles.keyboardAvoidingViewStyles}
3030
>
31+
{/* @ts-ignore - Type compatibility issue between different React versions */}
3132
<FlashList
3233
renderItem={MessageItem}
3334
inverted

fixture/react-native/src/Reminders.tsx

+1
Original file line numberDiff line numberDiff line change
@@ -188,6 +188,7 @@ const Reminders = () => {
188188
justifyContent: "space-between",
189189
}}
190190
>
191+
{/* @ts-ignore - Type compatibility issue between different React versions */}
191192
<FlashList
192193
ref={list}
193194
renderItem={renderItem}

fixture/react-native/src/SectionList.tsx

+1
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,7 @@ export const SectionList = () => {
149149
</Pressable>
150150
</View>
151151

152+
{/* @ts-ignore - Type compatibility issue between different React versions */}
152153
<FlashList
153154
ref={list}
154155
refreshing={refreshing}

fixture/react-native/src/twitter/TweetCell.tsx

+1-6
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,7 @@
1-
import { useNavigation } from "@react-navigation/native";
2-
import { StackNavigationProp } from "@react-navigation/stack";
31
import React from "react";
42
import { useRecyclingState } from "@shopify/flash-list";
53
import { Pressable } from "react-native";
64

7-
import { RootStackParamList } from "../constants";
8-
95
import Tweet from "./models/Tweet";
106
import TweetContent from "./TweetContent";
117

@@ -14,8 +10,7 @@ export interface TweetCellProps {
1410
}
1511

1612
const TweetCell = ({ tweet }: TweetCellProps) => {
17-
const { navigate } =
18-
useNavigation<StackNavigationProp<RootStackParamList, "Twitter">>();
13+
// We don't need navigation in this component
1914
const [showFullText, setShowFullText] = useRecyclingState(false, [tweet]);
2015
return (
2116
<Pressable

fixture/react-native/src/twitter/TweetContent.tsx

+1-8
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,5 @@
11
import React from "react";
2-
import {
3-
StyleSheet,
4-
View,
5-
Image,
6-
Text,
7-
ViewStyle,
8-
Pressable,
9-
} from "react-native";
2+
import { StyleSheet, View, Image, Text, ViewStyle } from "react-native";
103

114
import Author from "./models/Author";
125
import Tweet from "./models/Tweet";

fixture/react-native/src/twitter/Twitter.tsx

+4
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ const Twitter = ({
4646

4747
return (
4848
<RecyclerView
49+
// @ts-ignore - Type mismatch but RecyclerView can accept FlashList ref
4950
ref={instance}
5051
keyExtractor={(item) => {
5152
return item.id;
@@ -64,6 +65,7 @@ const Twitter = ({
6465

6566
return (
6667
<FlatList
68+
// @ts-ignore - Type mismatch but FlatList can accept FlashList ref
6769
ref={instance}
6870
// estimatedItemSize={150}
6971
data={debugContext.emptyListEnabled ? [] : tweets}
@@ -74,6 +76,7 @@ const Twitter = ({
7476
);
7577

7678
return (
79+
// @ts-ignore - Type compatibility issue between different React versions
7780
<FlashList
7881
ref={instance}
7982
onBlankArea={blankAreaTracker}
@@ -94,6 +97,7 @@ const Twitter = ({
9497
setTweets(reversedTweets);
9598
}, 500);
9699
}}
100+
// @ts-ignore - Type compatibility issue between different React versions
97101
CellRendererComponent={CellRendererComponent}
98102
onEndReached={() => {
99103
if (!debugContext.pagingEnabled) {
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,13 @@
11
import React, { useRef } from "react";
2-
import {
3-
FlashList,
4-
useBenchmark,
5-
useFlatListBenchmark,
6-
} from "@shopify/flash-list";
2+
import { FlashList, useFlatListBenchmark } from "@shopify/flash-list";
73

84
import Twitter from "./Twitter";
95
import Tweet from "./models/Tweet";
106

117
const TwitterBenchmark = () => {
128
const ref = useRef<FlashList<Tweet>>(null);
139
const [blankAreaTracker] = useFlatListBenchmark(
10+
// @ts-ignore - Type compatibility issue with useFlatListBenchmark
1411
ref,
1512
(res) => {
1613
if (!res.interrupted) {
@@ -20,6 +17,7 @@ const TwitterBenchmark = () => {
2017
},
2118
{ targetOffset: 200 * 100, speedMultiplier: 8, repeatCount: 20 }
2219
);
20+
// @ts-ignore - Type compatibility issue with ref passing
2321
return <Twitter instance={ref} blankAreaTracker={blankAreaTracker} />;
2422
};
2523
export default TwitterBenchmark;

fixture/react-native/yarn.lock

+4-4
Original file line numberDiff line numberDiff line change
@@ -8099,10 +8099,10 @@ typed-array-length@^1.0.7:
80998099
possible-typed-array-names "^1.0.0"
81008100
reflect.getprototypeof "^1.0.6"
81018101

8102-
typescript@4.8.4:
8103-
version "4.8.4"
8104-
resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.8.4.tgz#c464abca159669597be5f96b8943500b238e60e6"
8105-
integrity sha512-QCh+85mCy+h0IGff8r5XWzOVSbBO+KfeYrMQh7NJ58QujwcE22u+NUSmUxqF+un70P9GXKxa2HCNiTTMJknyjQ==
8102+
typescript@5.8.3:
8103+
version "5.8.3"
8104+
resolved "https://registry.yarnpkg.com/typescript/-/typescript-5.8.3.tgz#92f8a3e5e3cf497356f4178c34cd65a7f5e8440e"
8105+
integrity sha512-p1diW6TqL9L07nNxvRMM7hMMw4c5XOo/1ibL4aAIGmSAt9slTE1Xgw5KWuof2uTOvCg9BY7ZRi+GaF+7sfgPeQ==
81068106

81078107
unbox-primitive@^1.1.0:
81088108
version "1.1.0"

package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@
4646
"rw": "yarn fixture:expo:start",
4747
"e2e:up": "cd fixture/react-native/ios && brew tap wix/brew && brew install applesimutils && cd ../../../",
4848
"e2e:ios": "cd fixture/react-native && yarn e2e:build:ios && yarn e2e:test:ios",
49-
"rei": "yarn run-e2e-ios",
49+
"rei": "yarn run e2e:ios",
5050
"e2e:android": "cd fixture/react-native && yarn e2e:build:android && yarn e2e:test:android",
5151
"rea": "yarn run-e2e-android",
5252
"predeploy:website": "sh ./build_website.sh",
@@ -75,7 +75,7 @@
7575
"react": "18.3.1",
7676
"react-native": "0.76.5",
7777
"react-test-renderer": "18.2.0",
78-
"typescript": "^4.7.4"
78+
"typescript": "5.8.3"
7979
},
8080
"files": [
8181
"android",

src/FlashList.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -624,7 +624,7 @@ class FlashList<T> extends React.PureComponent<
624624
private getValidComponent(
625625
component: React.ComponentType | React.ReactElement | null | undefined
626626
) {
627-
const PassedComponent = component;
627+
const PassedComponent = component as any;
628628
return (
629629
(React.isValidElement(PassedComponent) && PassedComponent) ||
630630
(PassedComponent && <PassedComponent />) ||

yarn.lock

+4-4
Original file line numberDiff line numberDiff line change
@@ -7143,10 +7143,10 @@ type-fest@^0.7.1:
71437143
resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-0.7.1.tgz#8dda65feaf03ed78f0a3f9678f1869147f7c5c48"
71447144
integrity sha512-Ne2YiiGN8bmrmJJEuTWTLJR32nh/JdL1+PSicowtNb0WFpn59GK8/lfD61bVtzguz7b3PBt74nxpv/Pw5po5Rg==
71457145

7146-
typescript@^4.7.4:
7147-
version "4.7.4"
7148-
resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.7.4.tgz#1a88596d1cf47d59507a1bcdfb5b9dfe4d488235"
7149-
integrity sha512-C0WQT0gezHuw6AdY1M2jxUO83Rjf0HP7Sk1DtXj6j1EwkQNZrHAg2XPWlq62oqEhYvONq5pkC2Y9oPljWToLmQ==
7146+
typescript@5.8.3:
7147+
version "5.8.3"
7148+
resolved "https://registry.yarnpkg.com/typescript/-/typescript-5.8.3.tgz#92f8a3e5e3cf497356f4178c34cd65a7f5e8440e"
7149+
integrity sha512-p1diW6TqL9L07nNxvRMM7hMMw4c5XOo/1ibL4aAIGmSAt9slTE1Xgw5KWuof2uTOvCg9BY7ZRi+GaF+7sfgPeQ==
71507150

71517151
unbox-primitive@^1.0.1:
71527152
version "1.0.1"

0 commit comments

Comments
 (0)