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

react-native useRoute hook : Property '.....' does not exist on type 'object'

$
0
0

In my expo app, I'm using useRoute() hook in a functional component from react-navigation. I also use typescript.

The route I want to navigate to have only 1 parameter: identificationUrl
when I want to navigate to this screen, it gives me the following error :

Property 'identificationUrl' does not exist on type 'object'.ts(2339)

  const route = useRoute();  const navigation = useNavigation();  const [identificationUrl] = useState(route.params?.identificationUrl);

How to add the type of this parameter correctly to useRout?


Viewing all articles
Browse latest Browse all 6287

Trending Articles