How is () => {…} different from () => [duplicate]

When you open a block {} in an arrow function, the return isn’t implied anymore.

You have to write it down :

this.state.articles.filter((article) => {
  return article.category === filter 
})

Leave a Comment