Selected filters array.
Should remove all selected filters.
import { useProductFilters, useActions } from '@nosto/preact'
export default () => {
const { filters } = useProductFilters()
const { toggleProductFilter } = useActions()
return filters.map((filter) => <li>
<button
title="Remove Filter"
onClick={(e) => {
e.preventDefault()
toggleProductFilter(
filter.field,
filter.value,
false
)
}}
>
{filter.filter}: {filter.value}{' '}
<span>✕</span>
</button>
</li>)
}
Preact hook that import product facets state to the component.
Should always be at the top of the component!