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

Index.d.ts doesn't allow for useRef #162

Open
danielvandenberg95 opened this issue Nov 26, 2023 · 0 comments
Open

Index.d.ts doesn't allow for useRef #162

danielvandenberg95 opened this issue Nov 26, 2023 · 0 comments

Comments

@danielvandenberg95
Copy link

I copied the code into my project instead, and VSCode is suggesting the following type:

React.ForwardRefExoticComponent<{
    flickOnSwipe?: boolean | undefined;
    children?: any;
    onSwipe?: any;
    onCardLeftScreen?: ((dir: string) => void) | undefined;
    className?: any;
    preventSwipe?: any;
    swipeRequirementType?: any;
    swipeThreshold?: any;
    onSwipeRequirementFulfilled?: any;
    onSwipeRequirementUnfulfilled?: any;
} & React.RefAttributes<...>>

That type could be tighter, but React.FC doesn't accept the ref prop. See also https://stackoverflow.com/questions/60554808/react-useref-with-typescript-and-functional-component.

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

No branches or pull requests

1 participant