How to add click event?
zpaimon opened this issue · comments
hi
I want to add click event at rect ,but I don't know how to do ?
thanks.
Hey. I've added a property that allows to register event handlers. Simply update to v1.4.0 and check out docs here:
https://grubersjoe.github.io/react-activity-calendar/?path=/story/react-activity-calendar--event-handlers
Feel free to reopen this issue if needed.
<ActivityCalendar
data={data}
eventHandlers={{
onClick: event => activity => {
console.log({ event, activity });
alert(JSON.stringify(activity, null, 4));
},
onMouseEnter: event => activity => console.log('mouseEnter'),
}}
/>