August 2017
Beginner
374 pages
10h 41m
English
This component works similar to the PostList component. We pass an array of categories, and setFilter and clearFilter action creators. Additionally, we display a link to clear the filter:
import React from 'react'
import Filter from './Filter.jsx'
const FilterList = ({ categories, setFilter, clearFilter }) =>
<span>
{categories.map(
(category, i) =>
<span key={i.toString()}>
<Filter
name={category}
onClick={() => setFilter(category)} /> {' - '} </span> )} ...Read now
Unlock full access