Я использую плагин react-native-awesome-alerts
для отображения предупреждения на моем экране.Я создал собственное представление для предупреждения, но оно выдает мне эту ошибку
Невозможно добавить ребенка, у которого нет YogaNode, к родителю без функции меры!(Попытка добавить 'RCTRawText [text:}]' к 'RCTView')
Мой код такой:
_displayNotifyAlert(){
if(this.state.notifyAlert == true){
return (
<AwesomeAlert
show={true}
title="Service Cancellation"
message="Tell the shop why are you cancelling their services."
messageStyle={{ textAlign: 'center' }}
customView={this.renderCustomAlertView()}
showCancelButton={true}
showConfirmButton={true}
cancelText="Cancel"
confirmText="Cancel Service"
confirmButtonColor={Colors.default}
onCancelPressed={() => this._closeNotifyAlert()}
onConfirmPressed={() => this._cancelServices()}
/>
)
}
}
renderCustomAlertView = () => (
<View style={[ AppStyles.input ]}>
<TextInput
placeholder="Write your reason briefly."
underlineColorAndroid="transparent"
style={{ textAlignVertical: 'top', height: 100 }}
numberOfLines={5}
multiline={true}
maxLength={200}
onChangeText={(cancel_reason) => this.setState({cancel_reason})} />
}
</View>
)
Если я уберу эту строку customView={this.renderCustomAlertView()}
, ошибка исчезнет.Я не вижу неправильного кода, который я вставил в функцию renderCustomAlertView
.Поэтому я не могу отследить причину ошибки.Кто-нибудь сталкивался с такой же проблемой раньше?