react sort by string code example
Example: sort by string react
const myData = this.state.contacts
.sort((a, b) => a.name.localeCompare(b.name))
.map((item, i) => <List key={i} data={item} />);
Never look this up again
const myData = this.state.contacts
.sort((a, b) => a.name.localeCompare(b.name))
.map((item, i) => <List key={i} data={item} />);
Never look this up again