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

Typescript React Native navigation.push incorrect typing

$
0
0

In my react native app, I'm using @react-navigation/native-stack.

The following line gives an error:

navigation.push('ScreenName', {myParam});

The error is:

TS2345: Argument of type '[string, { myParam: string; }]' is not assignable to parameter of type '[any, string | number | symbol] | [any, string | number | symbol, any, any]'

This code does work and is how the documentation specifies it should be done. What should I do to make typescript think it's right?


Viewing all articles
Browse latest Browse all 6287

Trending Articles