-
Notifications
You must be signed in to change notification settings - Fork 25k
Closed
Closed
Copy link
Labels
Description
Description
Trying to remove non-present child list error occurred with specific case
(please check below reproduce or example)
Version
0.71.0
Output of npx react-native info
It doesn't related with dev environment. it is JS issue
this problem occurred within react-native/Libraries/Lists/ChildListCollection.js
Steps to reproduce
- use FlatList(A) as ListEmptyComponent within other FlatList(B, with empty data)
- inject data within FlatList(B) after ListEmptyComponent mounted
Snack, code example, screenshot, or link to a repository
just render below component
const ErrorComponent = () => {
const [data, setData] = useState<number[]>([])
useEffect(() => {
setTimeout(() => {
setData([1, 2, 3, 4, 5])
}, 2000)
}, [])
return (
<View style={{ flex: 1, justifyContent: 'center', alignItems: 'center' }}>
<FlatList
data={data}
renderItem={({ item }) => <Text>{item}</Text>}
ListEmptyComponent={
<FlatList data={['empty']} renderItem={({ item }) => <Text>{item}</Text>} />
}
/>
</View>
)
}