Closed ans-4175 closed 7 years ago
Hey, maybe you could change your sorting implementation using lodash or something lightweight like this
if (this.state.sortedProp.isAscending) { descendingMultiplier = [1, -1]; } else { descendingMultiplier = [-1, 1]; } sortedData.sort((a, b) => { if (a[sortedProp] < b[sortedProp]) { return descendingMultiplier[0]; } else if (a[sortedProp] > b[sortedProp]) { return descendingMultiplier[1]; } else { return 0; } }
Hey, maybe you could change your sorting implementation using lodash or something lightweight like this