I'm applying lazy load into flatlist. But I only fetch more data when scroll down the lasted item. How can I implement fetch more data when scroll up. I tried onRefresh I dont' know why the list didn't update but the data had changed. Anyone have ideas for this issues?
<FlatList
style={props.style}
renderItem={renderRow}
data={data}
keyExtractor={(item, index) => String(index)}
onRefresh={onRefresh}
/>
function onRefresh(){
dataFetch = fetchMoreData()
setData([ ...dataFetch, ...data ])
}
Please help me. Thank you