I have this array of object that i want to sort when i display them on my screen, sort them by type.here is a look of the array:
Array [
Object {
"lien": "get_praticien",
"name": "tag service centre 2",
"type": "Tag",
},
Object {
"lien": "get_praticien",
"name": "Ambulance",
"type": "Acte",
},
Object {
"lien": "get_praticien",
"name": "Réadaptation Fonctionnelle",
"type": "speciality",
},
Object {
"lien": "get_praticien",
"name": "Infirmité Motrice",
"type": "Tag",
},......
so i want the objects that have a type:"speciality" to be at the top of the flatlist, and the others after on whatever order. i'm using a flatlist :
<FlatList
data={this.state.dataSource}
keyExtractor={item=> { return item.id.toString()}}
renderItem= {({item})=> <MedItem Med={item} />} />
i'll appreciate you answers