I am passing parameters from one page to another page. I am also passing a link (http://wwww.yahoo.com) to the resulting page along with other parameters. Below is the code of my source page:
<View style={styles.searchButton}>
<Button style={styles.searchButton}
title="Go to Details"
onPress={() => {
this.props.navigation.navigate('SearchSer', {
itemId: services[0].ser,
otherParam: services[0],
In the below code, I am trying to put the link in TouchableOpacity by reading the parameter. When I tried to open the link, I get an error saying "JSON parse error". Below is my code and screen shot of the error:
<View>
<Text style={styles.Address1}> {JSON.stringify(otherParam["Phone"])}</Text>
<TouchableOpacity onPress={() => Linking.openURL(JSON.parse(JSON.stringify(otherParam["destURL"]))) }>
<Text style={styles.underLineText}>Distance and Directions</Text>
</TouchableOpacity>
</View>
destURL is http://www.yahoo.com and it is coming from my JSON file. any help will be highly appreciated.