Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion fixture/react-native/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"ios": "react-native run-ios",
"start": "react-native start",
"lint": "eslint . --ext .js,.jsx,.ts,.tsx",
"build": "tsc -b",
"build": "tsc -b ../../ && tsc -b",
"e2e:test:ios": "detox test -c ios.sim.release --artifacts-location /tmp/detox_artifacts/",
"e2e:build:ios": "detox build -c ios.sim.release",
"e2e:test:android": "detox test -c android.emu.release --artifacts-location /tmp/detox_artifacts/",
Expand Down
11 changes: 1 addition & 10 deletions fixture/react-native/src/twitter/Twitter.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,9 @@ import Tweet from "./models/Tweet";
export interface TwitterProps {
instance?: React.RefObject<FlashListRef<Tweet>>;
CellRendererComponent?: React.ComponentType<any>;
disableAutoLayout?: boolean;
}

const Twitter = ({
instance,
CellRendererComponent,
disableAutoLayout,
}: TwitterProps) => {
const Twitter = ({ instance, CellRendererComponent }: TwitterProps) => {
const debugContext = useContext(DebugContext);
const [refreshing, setRefreshing] = useState(false);
const remainingTweets = useRef([...tweetsData].splice(10, tweetsData.length));
Expand All @@ -38,7 +33,6 @@ const Twitter = ({
}).current;

return (
// @ts-ignore - Type compatibility issue between different React versions
<FlashList
ref={instance}
testID="FlashList"
Expand All @@ -58,7 +52,6 @@ const Twitter = ({
setTweets(reversedTweets);
}, 500);
}}
// @ts-ignore - Type compatibility issue between different React versions
CellRendererComponent={CellRendererComponent}
onEndReached={() => {
if (!debugContext.pagingEnabled) {
Expand All @@ -77,15 +70,13 @@ const Twitter = ({
/>
}
ListEmptyComponent={Empty()}
estimatedItemSize={150}
ItemSeparatorComponent={Divider}
data={debugContext.emptyListEnabled ? [] : tweets}
initialScrollIndex={debugContext.initialScrollIndex}
viewabilityConfig={viewabilityConfig}
onViewableItemsChanged={(info) => {
console.log(info);
}}
disableAutoLayout={disableAutoLayout}
/>
);
};
Expand Down
10 changes: 9 additions & 1 deletion fixture/react-native/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
{
"extends": "../../shared/tsconfig.base.json",
"references": [{ "path": "../../" }],
"compilerOptions": {
"rootDir": ".",
"outDir": "./dist",
"tsBuildInfoFile": "./dist/tsconfig.tsbuildinfo",
"paths": {
"react": ["./node_modules/@types/react"],
"react-native": ["./node_modules/react-native"]
}
},
"include": ["src/**/*", "e2e/**/*"]
}
2 changes: 1 addition & 1 deletion src/benchmark/useBenchmark.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ export interface BenchmarkResult {
*/

export function useBenchmark(
flashListRef: React.RefObject<FlashListRef<any>>,
flashListRef: React.RefObject<FlashListRef<any> | null>,
callback: (benchmarkResult: BenchmarkResult) => void,
params: BenchmarkParams = {}
) {
Expand Down
2 changes: 1 addition & 1 deletion src/benchmark/useFlatListBenchmark.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ export interface FlatListBenchmarkParams extends BenchmarkParams {
* It's recommended to remove pagination while running the benchmark. Removing the onEndReached callback is the easiest way to do that.
*/
export function useFlatListBenchmark(
flatListRef: React.RefObject<FlatList<any>>,
flatListRef: React.RefObject<FlatList<any> | null>,
callback: (benchmarkResult: BenchmarkResult) => void,
params: FlatListBenchmarkParams
) {
Expand Down
Loading