fix: replace FlashList with FlatList to fix black screen in ScrollView
FlashList cannot be nested inside ScrollView. Changed to FlatList with scrollEnabled=false to allow proper rendering within the parent ScrollView. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
parent
a8b5ee5256
commit
57b92ac52f
|
|
@ -1,4 +1,4 @@
|
||||||
import { FlashList } from '@shopify/flash-list';
|
import { FlatList } from 'react-native';
|
||||||
import { Image } from 'expo-image';
|
import { Image } from 'expo-image';
|
||||||
import { LinearGradient } from 'expo-linear-gradient';
|
import { LinearGradient } from 'expo-linear-gradient';
|
||||||
import { useLocalSearchParams, useRouter } from 'expo-router';
|
import { useLocalSearchParams, useRouter } from 'expo-router';
|
||||||
|
|
@ -376,7 +376,7 @@ export default function HomeScreen() {
|
||||||
setGridWidth(width)
|
setGridWidth(width)
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<FlashList
|
<FlatList
|
||||||
data={displayCardData}
|
data={displayCardData}
|
||||||
renderItem={({ item, index }) => (
|
renderItem={({ item, index }) => (
|
||||||
<Card
|
<Card
|
||||||
|
|
@ -393,9 +393,8 @@ export default function HomeScreen() {
|
||||||
)}
|
)}
|
||||||
keyExtractor={(item) => item.id!}
|
keyExtractor={(item) => item.id!}
|
||||||
numColumns={numColumns}
|
numColumns={numColumns}
|
||||||
estimatedItemSize={cardWidth * 1.5}
|
|
||||||
showsVerticalScrollIndicator={false}
|
showsVerticalScrollIndicator={false}
|
||||||
scrollEventThrottle={Platform.OS === 'ios' ? 16 : 50}
|
scrollEnabled={false}
|
||||||
/>
|
/>
|
||||||
</View>
|
</View>
|
||||||
)}
|
)}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue