In react component I have made a function as
handleClick(event, key, value) {
event.preventDefault()
this.setState({
query:"",
key:key,
value:value
});
this.props.onClick(this.state);
console.log("key...." + key );
console.log("val...." + value);
}
this should be called when I am clicking a link
onClick={(e) => this.handleClick(e, {key}, {el}) }
Also using connect I am dispatching action as follows
export const mapDispatchToProps = (dispatch) => ({
onClick: (query, key, value) => dispatch(onSearch(query,key, value)
)
});
But on search method key and value are coming as undefined.But in handleClick function I am getting
key....[object Object]
val....[object Object]