I am doing a recent searches functionality by fetching an array from redux store and mapping through it get the values out of it.
<ul className="sidebar__list">
{searches.map((search, i) => {
return (
<li className="sidebar__listItem" key={i}>
<Link
to="/venues"
onClick={this.onClickRecentSearches(search.query, search.location)}
className="sidebar__listItemLink"
>
{search.query} in {search.location}
</Link>
</li>
);
})}
</ul>
What I want to do is dispatch a action on click. I have a fetchVenues action in reduce which require two inputs. How can i target the values of array and parse it into my action
onClickRecentSearches = (place, location) => {
this.props.fetchVenues(place, location);
};
e.target only works for input.