I have an object which contains media_id with some sort of link which is navigating to my Audio screen page and a second media_id contains a string which is going to video screen page. How can I tell between them to navigate send them to their specific pages. My code is below:
API:
{
"id": 602,
"title": "Reflections on Africa",
"media_id": "https://cdn.islamicmedia.com.au/site/2020/03/2019-11-18-Reflections-on-Africa-by-
},
{
"id": 595,
"title": "Reflections on Africa ",
ahmed-bassal/",
"media_id": "8ZVwBwq2cTs",
},`
My code (will provide more code if u want). I know I'm doing something wrong so pls correct me
<TouchableOpacity
onPress={() => {
item.media_id === String
? this.props.navigation.navigate('Video', {
id: item.id,
})
: this.props.navigation.navigate('Audio', {
id: item.id,
});
}}>