I’m trying to pass the pressed product data to the product screen using RN expo route but I’m getting
TypeError: Cannot read property ‘params’ of undefinedenter image description here
// Stack
<Stack screenOptions={{headerShown: false}}>
<Stack.Screen name="(tabs)" />
<Stack.Screen name="(prod)" />
</Stack>
// Product Screen
const ProductScreen = props => {
const getProduct = props?.route?.params?.item;
console.log("Products ", getProduct);
return (
<View>
<Text>ProductScreen</Text>
</View>
);
};
New contributor
zakria-abdelgny is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.