Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

react-kit: DateInput. Fix mouse event callbacks signature #128

Open
sutarmin opened this issue Apr 24, 2019 · 1 comment
Open

react-kit: DateInput. Fix mouse event callbacks signature #128

sutarmin opened this issue Apr 24, 2019 · 1 comment

Comments

@sutarmin
Copy link
Contributor

We have wrong types for the following DateInput props: onFocus, onBlur, onMouseEnter and onMouseLeave. Currently, their inferred type is (((event: React.MouseEvent<HTMLElement>) => void) & (() => void)) | undefined which doesn't allow us to pass a callback that requires MouseEvent (because of () => void part).

The reason is that this props declared twice: on the TFullInputProps (with correct signature) and on TDateInputOwnProps itself (wrong one). The solution here is to simply remove these props from TDateInputOwnProps and let them be inferred from TFullInputProps.

@raveclassic
Copy link
Contributor

Be careful because these handlers may be throttled and this may conflict with event pooling done by React under the hood.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants