I want to connect react native project to an api. but it showing the error
ERROR TypeError: undefined is not an object (evaluating 'props.restaurantData.map')
export default function RestaurantItems(props) {
return (
<>
<TouchableOpacity activeOpacity={0.5} style={{ marginBottom: 30 }}>
{props.restaurantData.map((restaurant, index) => (
<View key={index} style={{
marginTop: 10,
padding: 15,
backgroundColor: 'white'
}}>
<RestaurantImage image={restaurant.image_url} />
<RestaurantInfo
name={restaurant.name}
rating={restaurant.rating} />
</View>
))}
</TouchableOpacity>
</>
)
}
console and check props.restaurantData.map