In ReactNative, I have a property that might or might not be passed down to a class object. Is there a way like in Java to check to see the property is null or not?
In my case, I have this.props.overrideAccessibilityLabel that might be passed down or not. I only want to use it when it is passed down:
render() {
return (
<View
accessibilityLabel={this.props.currMessage.text}
if {...props.myAccessibilityLabel} {
...accessibilityLabel={...props.myAccessibilityLabel}
}
>
<Text1
// ...
>
</Text1>
</View>
);
}