0

よくわかりません。マップを経由して特定のウェイに戻る必要がありますか?

componentDidMount() {
  // read the items db
  let categories = [];
  items.map(cat => {
    if (categories.indexOf(cat.category) === -1) {
      categories.push(cat.category);
    }
  });
  console.log(categories);
  this.setState({ categories: categories });
}
4

3 に答える 3