I need to know how to set a default value for props to React Native. I have the following code:
<View style={{ ...styles.textBox, ...props.bg }}>
<Text style={{ ...styles.pretitle, ...props.style }}>{props.pretitle}</Text>
<Text style={{ ...styles.title, ...props.style2 }}>{props.title}</Text>
<Text style={styles.introduction}>{{ '', ...props.introduction }}</Text>
</View>
If props.introduction
is 0
I want to set it to empty, like: '', or to have some other value, like: 'Not set'.
Thank you