import {
Button,
FlatList,
ListRenderItemInfo,
StyleSheet,
Text,
View,
} from 'react-native';
import { useCallback, useState } from 'react';
const INITIAL_DATA = Array.from({ length: 10000 }).map((_, i) => i);
const MAINTAIN_VISIBLE_CONTENT_POSITION = {
minIndexForVisible: 0,
autoscrollToTopThreshold: 10,
};
function App() {
const [data, setData] = useState(INITIAL_DATA);
const removeItem = useCallback(() => {
setData(prevData => prevData.slice(1));
}, [setData]);
return (
<View style={styles.screen}>
<Button title="Remove Item" onPress={removeItem} />
<FlatList
style={styles.list}
data={data}
renderItem={renderItem}
maintainVisibleContentPosition={MAINTAIN_VISIBLE_CONTENT_POSITION}
keyExtractor={item => item.toString()}
/>
</View>
);
}
function renderItem(props: ListRenderItemInfo<number>) {
return <ListItem {...props} />;
}
function ListItem({ item }: ListRenderItemInfo<number>) {
return (
<View style={styles.container}>
<Text style={styles.text}>{item}</Text>
</View>
);
}
const styles = StyleSheet.create({
screen: {
flex: 1,
backgroundColor: '#fff',
paddingTop: 48,
},
list: {
flex: 1,
},
listContent: {
padding: 12,
gap: 12,
},
container: {
borderWidth: 1,
borderColor: '#000000',
padding: 12,
alignItems: 'center',
justifyContent: 'center',
},
footerContainer: {
flexDirection: 'row',
},
text: {
fontSize: 14,
},
leadingFooterItem: {
flex: 1,
backgroundColor: 'blue',
height: 50,
},
trailingFooterItem: {
backgroundColor: 'red',
width: 50,
aspectRatio: 1,
},
buttonsContainer: {
flexDirection: 'row',
justifyContent: 'space-between',
alignItems: 'center',
},
});
export default App;
Description
If an item is removed from the start of a Flatlist, which satisfy the following conditions:
windowSize{ minIndexForVisible: 0, autoscrollToTopThreshold: 10 }then an unwanted scrolling behaviour is produced.
Example Code
Note that I also tested
0.82.0-nightly-20250722-2c3a00b7bas I see the same behaviourSteps to reproduce
Remove ItemReact Native Version
0.80.1
Affected Platforms
Runtime - iOS
Areas
Fabric - The New Renderer
Output of
npx @react-native-community/cli infoStacktrace or Logs
MANDATORY Reproducer
https://github.com/itsramiel/FlatlistScroll
Screenshots and Videos
Screen Recording
Simulator.Screen.Recording.-.iPhone.16.Pro.-.2025-07-22.at.12.27.19.mp4
Screen.Recording.2025-07-22.at.12.27.24.PM.mov
I am mainly concered with the new arch as that is what I am using in my app but just for reference and in case it helps, it used to work fine on the old arch
Screen Recording(Old Arch as Reference)
Simulator.Screen.Recording.-.iPhone.16.Pro.-.2025-07-22.at.12.33.03.mp4
Screen.Recording.2025-07-22.at.12.33.07.PM.mov