I am trying to make a nested FlatList in my apps.
I use accordion components by native base as the parent of my FlatList, and in the content of each section, I'm trying to put a FlatList. However, I ended up with the error about "you must pass a unique listKey props to each sibling list"
componentWillMount() {
var toPush = []
const request = axios({
method: "POST",
url: "XXX",
data: {
customer_id: this.props.User.userData.id
},
headers: {
"Content-Type": "application/json"
}
}).then(response => {
response.data.map(history => {
this.getDish(history.order_id).then((dish)=>{
this.setState({
dataArray: [...this.state.dataArray,
{
title: "Restaurant:" + history.restaurant_name + " , " + "Order id : " + history.order_id,
content: <Item data={dish} listKey={history.order_id}/>
}
]
})
})
})
this.setState({
dataArray: toPush
})
How do I solve this issue?