0

I have a big problem, because i need to upgrade libraries of some project, but I've never used React native. I upgrade react-native-elements form version 0.19 to 1.1 and I get many errors about unexisting properties in Button component.

Example part of code:

<Button
    backgroundColor={styles.palette.transparent}
    onPress={this.connectWithEmail}
    title={I18n.t('CONFIRM')}
    disabled={!this.state.password || !this.state.email}
    disabledStyle={styles.modal.actionButtonDisabled}
    underlayColor={styles.palette.transparent}
    containerViewStyle={styles.modal.actionButtonContainer}
    textStyle={[
        styles.modal.actionButtonText,
        {color: (this.state.password && this.state.email) ? styles.palette.secondary : styles.palette.textLight}
    ]}
/>

Ok, so I got error for this button like: Property 'backgroundColor' does not exist on type 'IntrinsicAttributes & IntrinsicClassAttributes<Button> & Readonly<ButtonProps> & Readonly<{ children?: ReactNode; }>' but I found info, that backgroundColor property is not exist in v 1.1 for button so I replace it using buttonStyle property in this way:

buttonStyle={{backgroundColor: styles.palette.transparent}}

My question is: How can I replace the rest of missing props like: underlayColor, containerViewStyle, and textStyle? I can't find any info about it in documentation and realese notes of react-native-documentation.

Jaroslaw K.
  • 5,224
  • 2
  • 39
  • 65

1 Answers1

1

containerViewStyle == containerStyle

textStyle == titleStyle

There is no UnderlayColor because the react-native-elements button is configured based on the TouchableNativeFeedback ' or 'TouchableOpacity'.

hong developer
  • 13,291
  • 4
  • 38
  • 68