Currently in my react native application, I have integrated @react-navigation/native-stack.
However, the following line of code is causing an error:
navigation.push('ScreenName', {myParam});
The error message reads as follows:
TS2345: Argument of type '[string, { myParam: string; }]' is not assignable to parameter of type '[any, string | number | symbol] | [any, string | number | symbol, any, any]'
Despite following the documentation provided, TypeScript is flagging this as incorrect. How can I rectify this issue?
Edit: Sample of my code
export default function Home({navigation}: NativeStackScreenProps<any>) {
return (
<View style={styles.container}>
<Button onPress={() => navigation.push('ScreenName', {myParam: 'stuff'})} title={'Go to ScreenName'}/>
</View>
);
}