Closed carlinisaacson closed 8 years ago
The snippet below is working for me to style validationErrorWidgets per widget type
formStyles={{
TextInputWidget: {
rowContainer: Styles.textInputRow,
textInputInline: Styles.textInput,
validationError: {
color: 'green'
},
validationErrorRow: {
backgroundColor: 'yellow'
}
},
}}
That is working for me. I was setting it up the way Farid showed in issue #21. I implemented styles like this:
formStyles={{
TextInputWidget: {
rowContainer: Styles.textInputRow,
textInputInline: Styles.textInput
},
ValidationErrorWidget: {
validationErrorRow: {
backgroundColor: 'yellow'
},
validationError: {
color: 'green',
}
}
}}
It looks like, because the ValidationErrorWidget
is rendered from within the TextInputWidget
, the error styles have to go in the text input styles.
Thanks @gabceb. Closing.
When I try to set the styles via
formStyles
in my GiftedForm component the styles don't change. I did some debugging and when thegetStyles
function is called from theValidationErrorWidget
this line in the WidgetMixin returns undefined fortypeof this.props.formStyles[this.props.type][styleNames[i]]
.Also tried changing styles in the example app and there is no change there either.