So I have a page of with a flat list and a toggle between 2 sets of data, current events and past events.
They will occupy the same UI and never be displayed at the same time.
The data will all be loaded asynchronously at the beginning, with the current events displayed first, therefore ill put the data in the flatlist to start.
I need to decide is it better / is there even a difference to have 2 separate flatlists and viewlogic between the 2, or one flatlist that switches the data, i.e.
1. 1 flat list and switch the data
<View>
<FlatList
data={(currentEventsSelected) ? currentEvents : pastEvents}
keyExtractor={item => item.eventID}
renderItem={({ item }) => renderItem(item}
/>
<View/>
*1. 2 flat list and switch the active lists
<View>
{
(currentEventsSelected)
? <FlatList
data={currentEvents}
keyExtractor={item => item.eventID}
renderItem={({ item }) => renderItem(item}
/>
<View/>
: <FlatList
data={pastEvents}
keyExtractor={item => item.eventID}
renderItem={({ item }) => renderItem(item}
/>
<View/>