score:1

Accepted answer
filterMusicLibrary() {
  const filteredMusicItems = this.state.musicGet.filter((music) =>
    (!this.state.title || music.title && music.title.includes(this.state.title)) &&
    (!this.state.composer || music.composer && music.composer.includes(this.state.composer)) &&
    (!this.state.arranger || music.arranger && music.arranger.includes(this.state.arranger)) &&
    (!this.state.instrumentation || music.instrumentation && music.instrumentation.includes(this.state.instrumentation))
  );
  return filteredMusicItems.map((music) =>
    <MusicLibraryItem key={music.id} music={music} history={this.props.history}/>
  );
}

Related Query

More Query from same tag