I have an array of objects and I am trying to iterate with map
in this array after the sort
method, however it is iterating in the normal array, disregarding the sort
method and reordering. p>
{this.mapasVetados
.sort((a,b) => {
return a.ordem - b.ordem
})
.map(mapa => {
if (mapa.vetado) {
return (<Vetados
mapa = {mapa.nome}
ordem = {mapa.ordem}
/>)
}
})
}