I'm very new in React Native and I'm working on application which is retrieving a listings from API and the backend is using NoSql database. My goal is to sort the listings via date of adding. Here is the method which is adding the listings:
const renderListingContent = (listingList, containerStyle = {}) =>
listingList?.length === 0 ? (
<View style={{ paddingTop: 155 }}>
<EmptyListing
type={listingStatus}
setShowRadiusModal={setShowRadiusModal}
/>
</View>
) : (
<>
<View style={[styles.listingsWrapper, containerStyle]}>
{listingList?.map(listing => (
<ListingPreview
listing={listing}
key={listing?.guid}
onPress={() => {
navigation.navigate('ViewListing', {
listingId: listing.guid,
onGoBack: () => setShouldRefresh(false),
});
}}
/>
)) || null}
</View>
{!noMoreData && (
<View style={styles.bottomListingLoader}>
{isAddLoading ? <Loader /> : null}
</View>
)}
</>
);
If I have to share any other code please let me know.