dptoot / react-event-calendar

A React calendar component to display events
131 stars 55 forks source link

Fix missing event data in handler callbacks #26

Closed idolize closed 8 years ago

idolize commented 8 years ago

Fixes #24

There is currently a bug where event data will be missing when the (e.g. onMouseOver) callbacks trigger - I currently get false on occasion for the eventData param in my callback.

I believe this is because this.sharedArguments is only computed and cached once, when the component is created, and never updated as the props change. So on each subsequent re-render, there is a chance the two will become out of sync.

This fixes it by updating this.sharedArguments each time the props update.

@calvinclaus @dptoot

idolize commented 8 years ago

@dptoot Mind giving this a look?

dptoot commented 8 years ago

Thanks @calvinclaus

Sorry it took me so long to get on this. Life is hectic these days.

idolize commented 8 years ago

@dptoot No problem - thanks!

idolize commented 8 years ago

Do you mind pushing a new version to npm when you get a chance?