Quantcast
Channel: Active questions tagged react-native+typescript - Stack Overflow
Viewing all articles
Browse latest Browse all 6214

how to type event in react native with defaultPrevented?

$
0
0

i am getting an event object from react navigation with its emit function. e.g.:

  const event = navigation.emit({                type: "tabPress",                target: route.key,                canPreventDefault: true,              });

the event type from above is like this: const event: EventArg<"tabPress", any, any>but i get an error with defaultPrevented prop. e.g.:

//Property 'defaultPrevented' does not exist on type 'EventArg<"tabPress", any, any>'. if (!event.defaultPrevented) { 

i have searched and failed to find a solution, i just don't wanna use any.


Viewing all articles
Browse latest Browse all 6214

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>