Skip to content

Making Pressable onHoverIn Typescript happy? #2107

Answered by shawngustaw
jysung asked this question in Help
Discussion options

You must be logged in to vote

You can use declaration merging to annotate web specific properties you're using, i.e.:

// overrides.d.ts
import type { MouseEvent } from 'react';

declare module 'react-native' {
  interface TouchableWithoutFeedbackProps {
    onHoverIn?: (event: MouseEvent<HTMLElement>) => void;
    ...
  }
}

This has been working for me. Hope it helps!

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by necolas
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Help
Labels
None yet
2 participants