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>
);
};
2
Answers
Below is the Expo Router documentation for you.
Passing parameters to the routes
Using hook
Link component
Getting the data in the destination route