-
Notifications
You must be signed in to change notification settings - Fork 147
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
Typescript error when using useSwipable hook and applying handlers. #140
Comments
I suspect the type definition for ie.
|
@domhede Thanks for the issue and finding a possible solution. Able to make a PR? Do you have any insight as to why our test passes? What version of typescript are you using? Test: https://github.com/dogfessional/react-swipeable/blob/master/types/test.tsx#L54-L58 |
@domhede Do you know if this is the root issue, from tslint, palantir/tslint#4589? |
@hartzis I don't think so, the error message seems to point to the types of |
Fixes FormidableLabs#140. Adds test to explicitly cover this case because it seems `dtslint` doesn't catch the issue when a handlers instance is spread during an `Element` instantiation. The React types do [declare the arg correctly](https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/react/index.d.ts#L85).
Fixes FormidableLabs#140. Adds test to explicitly cover this case because it seems `dtslint` doesn't catch the issue when a handlers instance is spread during an `Element` instantiation. The React types do [declare the arg correctly](https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/react/index.d.ts#L85).
Using the hook, I have typed the handlers as SwipeableHandlers and spread them on to the swipeable div. However this results in a Typescript error. Any help would be most appreciated. Thanks
Error
Code
The text was updated successfully, but these errors were encountered: