[javascript - Sort an array of objects in React and render them - Stack Overflow](https://stackoverflow.com/questions/43572436/sort-an-array-of-objects-in-react-and-render-them)
```
// ... rest of code
// copy your state.data to a new array and sort it by itemM in ascending order
// and then map
const myData = [].concat(this.state.data)
.sort((a, b) => a.itemM > b.itemM ? 1 : -1)
.map((item, i) =>
<div key={i}> {item.matchID} {item.timeM}{item.description}</div>
);
// render your data here...
```
示例:
标签:sort,render,react,item,api,itemM,array,排序 From: https://www.cnblogs.com/ministep/p/16998280.html