react-native-app-intro icon indicating copy to clipboard operation
react-native-app-intro copied to clipboard

Error with Android pagination

Open auser opened this issue 9 years ago • 0 comments

There is an error when rendering pagination on Android only. I've tracked it down to the DoneButton <Text> rendering:

This causes the dots to rerender (props changed) which causes the pagination to return to the previous page:

    <View style={[styles.btnContainer, { height: 0, paddingBottom: 5 }]}>
      <TouchableOpacity style={styles.full}
        onPress={ isDoneBtnShow ? onDoneBtnClick : onNextBtnClick}
      >
       <Text style={[styles.nextButtonText, { color: rightTextColor }]}>
         {isDoneBtnShow ? doneBtnLabel : nextBtnLabel}
       </Text>
      </TouchableOpacity>
    </View>

This, on the other hand does not cause a rerender or the bug:

    <View style={[styles.btnContainer, { height: 0, paddingBottom: 5 }]}>
      <TouchableOpacity style={styles.full}
        onPress={ isDoneBtnShow ? onDoneBtnClick : onNextBtnClick}
      >
       <Text style={[styles.nextButtonText, { color: rightTextColor }]}>
         {doneBtnLabel}
       </Text>
      </TouchableOpacity>
    </View>

The difference is the ternary operator in the <Text /> element. Could use some thoughts on how to approach this bug. Am I the only one seeing this?

auser avatar Aug 22 '16 07:08 auser