Question:
I’d like to know how to “double sort” items in react native in order to obtain a double criteria sorted list.The data I receive from BE is a list of match: every match is an object containing 2 players, a time and a competition.
I d’like to sort items by time (so that a today match is showed before a tomorrow match) and by competition (so that a more important competition is showed before a lower one).
If two or more matches are played on the same day and within the same competition, the earlier match is showed before.
A schema better shows what I mean: I’d like to customize the UI oc the day-row, the competition-row and the match-row.

The data I receive from BE are formatted in this way:

How could I obtain what I want? I’ve tried with sortable list but with no result.
TY in advance
Answer:
The javascript docs for sort show that you can sort using an arbitrary function. I would write a function which first compares days and then compares competitions:If you have better answer, please add a comment about this, thank you!