NdYAG/react-rater

Why does it call same callback in onRate and willRate

ImadBoumzaoued opened this issue · 1 comments

This causes a problem with rating onMouseEnter

NdYAG commented

@ImadBoumzaoued
Please take a look of the example, you can differentiate event type in callback.
https://github.com/NdYAG/react-rater/blob/master/example/index.js#L37

It might somehow be a little strange when I look back of the design, because usually calling onRate on click is enough for most usages. Could you tell me in what scenarios you'd use callback for onMouseEnter?

I'd like to offer there callback attributes, so that it's possible to write:

<Rater beforeRate={} onRate={} afterRate={} />

But onRate and afterRate might be confusing. Anyway, thank you for bring this up, I'll think about it in next update.