a = this.state.results.sort((a, b) => a.title > b.title)
this.setState({ ...this.state, resultsDisplay: a })
break
case 'trending':
a = this.state.results.sort((a, b) => a.bookID - b.bookID)
this.setState({ ...this.state, resultsDisplay: a })
break
case 'rating':
a = this.state.results.sort(
(a, b) => b.average_rating - a.average_rating
)
this.setState({ ...this.state, resultsDisplay: a })
break
case 'price':
a = this.state.results.sort((a, b) => a.price - b.price)
this.setState({ ...this.state, resultsDisplay: a })
break
default:
return this.state.results
}
Can anyone help me why alphabet filter isnt working?
Use an online paste tool like hastebin and then come back. Try not to post huge code snippets here.
oh, yeah
Обсуждают сегодня