I want my app to calculate dates. To do so, i input 3 dates and with a button, it should print them in an alert. When testing, i seem to have a bug. My button is :
<TouchableOpacity onPress={() => {{Alert.alert("Box", <calculator date {this.state.dateInit} />)}}}>
<View style={styles.button}>
<Text style={styles.buttonText}>Calculer</Text>
</View>
</TouchableOpacity>
and calculator refers to
class calculator extends Component {
render() {
return (
<Text>Le CQE Initial etait le {String(this.props.date)}</Text>
);
}
}
I tried with this.props.date.toString() and String(this.props.date) both in the alert and the class and i still get an error
TypeError: expected dynamic type string but had type object
while toString() or String(...) should have translated it as string.
Thx for the help !