I am getting the following error in Expo: "You need to specify name or key when calling navigate with an object as the argument."
I have a main piece of code calling the LoginOptions include:
<LoginOptions title="Don't have a business account?" link="Create a free account" press="CreateAccount"/>
I am trying to pass the navigation destination as a "variable?? - not sure what the correct word is". LoginOptions looks like this:
import React from 'react';
import { View, Text, TouchableWithoutFeedback } from 'react-native';
import { useNavigation } from '@react-navigation/native';
import defaultStyles from "../../config/styles";
function LoginOptions ({title, link, press }) {
const navigation = useNavigation();
return (
<View>
<Text style={defaultStyles.logBold}>
{title}
</Text>
<TouchableWithoutFeedback onPress={() => navigation.navigate({press})} >
<Text style={defaultStyles.logUnder} >
{link}
</Text>
</TouchableWithoutFeedback>
</View>
);
}
export default LoginOptions;