0

Android : 4.4.2 , 8.0

React-native : 0.61.4

It only happens on android.

https://gfycat.com/flimsyastonishingguineafowl

<FlatList
    style={{ transform: [{ scaleY: -1 }], marginBottom: 10 }}
    removeClippedSubviews
    initialNumToRender={20}
    data={replyList}
    onEndReached={this.nextPage}
    contentContainerStyle={{ justifyContent: 'flex-end', flexGrow: 1 }}
    keyboardShouldPersistTaps="handled"
    pinchGestureEnabled={false}
    keyboardDismissMode="none"
    keyExtractor={item => `${item.replyUID}reply`}
    showsVerticalScrollIndicator={false}
    renderItem={({ item }) => (
      <RenderReplyItem
        item={item}
      />
    )}
    onScroll={handleScroll}
    ref={setRef}
    scrollEventThrottle={16}
  />

export default class RenderReplyItem extends PureComponent {
  render() {
    const {
      item,
    } = this.props;

    return (
      <View style={[styles.replyContainer, { alignSelf: 'center', transform: [{ scaleY: -1 }] }]}>
          <View style={styles.replyBackground}
          >
              <Text style={styles.replyContentStyle}
              >
                {item.content}
              </Text>
            <View style={styles.replyBottom}>
              <Text style={styles.replyregisterDate}>
                {item.replyUID}
              </Text>
          </View>
          </View>
      </View>
    );
  }
}

The screen turns white after 80 items have been rendered.

Then scroll down again and the screen will come back and the scroll will move randomly.

Other FlatLists experienced a similar phenomenon and disappeared after setting keyExtractor. However, only after this page, the same thing happens after you set the keyExtractor.

oijafoijf asnjksdjn
  • 1,115
  • 12
  • 35