diff --git a/fixture/react-native/package.json b/fixture/react-native/package.json index 4d65d5a6d..3e415f8da 100644 --- a/fixture/react-native/package.json +++ b/fixture/react-native/package.json @@ -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/", diff --git a/fixture/react-native/src/twitter/Twitter.tsx b/fixture/react-native/src/twitter/Twitter.tsx index 4ddf5dd79..c4d8b07bc 100644 --- a/fixture/react-native/src/twitter/Twitter.tsx +++ b/fixture/react-native/src/twitter/Twitter.tsx @@ -17,14 +17,9 @@ import Tweet from "./models/Tweet"; export interface TwitterProps { instance?: React.RefObject>; CellRendererComponent?: React.ComponentType; - 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)); @@ -38,7 +33,6 @@ const Twitter = ({ }).current; return ( - // @ts-ignore - Type compatibility issue between different React versions { if (!debugContext.pagingEnabled) { @@ -77,7 +70,6 @@ const Twitter = ({ /> } ListEmptyComponent={Empty()} - estimatedItemSize={150} ItemSeparatorComponent={Divider} data={debugContext.emptyListEnabled ? [] : tweets} initialScrollIndex={debugContext.initialScrollIndex} @@ -85,7 +77,6 @@ const Twitter = ({ onViewableItemsChanged={(info) => { console.log(info); }} - disableAutoLayout={disableAutoLayout} /> ); }; diff --git a/fixture/react-native/tsconfig.json b/fixture/react-native/tsconfig.json index 844591e99..2c5af862b 100644 --- a/fixture/react-native/tsconfig.json +++ b/fixture/react-native/tsconfig.json @@ -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/**/*"] } diff --git a/src/benchmark/useBenchmark.ts b/src/benchmark/useBenchmark.ts index 78f3e6d23..549e09c6d 100644 --- a/src/benchmark/useBenchmark.ts +++ b/src/benchmark/useBenchmark.ts @@ -46,7 +46,7 @@ export interface BenchmarkResult { */ export function useBenchmark( - flashListRef: React.RefObject>, + flashListRef: React.RefObject | null>, callback: (benchmarkResult: BenchmarkResult) => void, params: BenchmarkParams = {} ) { diff --git a/src/benchmark/useFlatListBenchmark.ts b/src/benchmark/useFlatListBenchmark.ts index c269664b9..37b2fad83 100644 --- a/src/benchmark/useFlatListBenchmark.ts +++ b/src/benchmark/useFlatListBenchmark.ts @@ -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>, + flatListRef: React.RefObject | null>, callback: (benchmarkResult: BenchmarkResult) => void, params: FlatListBenchmarkParams ) {