I am getting the following error
Uncaught Invariant Violation: Expected
onClicklistener to be a function, instead got a value ofobjecttype.
when I try to pass a value (which is an array) to a function when clicking a div. If this can not be done, what would be the best way to handle this?
itemsArray(arr) {
let items = [];
let self = this;
const grouped = this.groupBy(arr, item => item.source);
grouped.forEach(function(value, key) {
switch(key.toString().toLowerCase()) {
case "occ_al": return items.push(<div onClick={self.listAllActivities(value)} className="recentActivityChannels"><img src={occ} width="15" /></div>)
}
})
items.push(<div className="clearFloat"></div>);
return items;
}
listAllActivities(arr){
let items = [];
var self = this;
const grouped = this.groupBy(arr, date => getDateServiceTab(date.date));
grouped.forEach(function(value, key) {
value.map((map) => {
//removed as its not important
return items;
}