We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
When data prop is empty array, scrollToEnd is crashing the app. The issue reproduces always.
data
scrollToEnd
export default function HomeScreen() { const { top } = useSafeAreaInsets(); const [data] = useState<Item[]>([]); const ref = useRef<FlashList<Item>>(null); const renderItem = ({ item }: { item: Item }) => { return <Text>{item.title}</Text>; }; return ( <View style={[styles.container, { paddingTop: top }]}> <Pressable style={styles.scrollButton} onPress={() => ref.current?.scrollToEnd()} > <Text>Scroll</Text> </Pressable> <FlashList ref={ref} style={styles.list} renderItem={renderItem} data={data} keyExtractor={(item) => item.title} estimatedItemSize={20} /> </View> ); }
App should not crash.
The code provided in description is enough to reproduce the issue.
1.7.1
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Current behavior
When
data
prop is empty array,scrollToEnd
is crashing the app. The issue reproduces always.Simulator.Screen.Recording.-.iPhone.14.Pro.-.2025-01-22.at.20.41.30.mp4
Expected behavior
App should not crash.
To Reproduce
The code provided in description is enough to reproduce the issue.
Platform:
Environment
1.7.1
The text was updated successfully, but these errors were encountered: