Skip to content

FlatList onViewableItemsChanged method does't trigger when first render? #25812

Description

@wenzhihao123

React Native version: +

Steps To Reproduce

When i used FlatList in Android, when i first entered the page, why onViewableItemsChanged method does't trigger? Generally speaking, first render also means that the visibility of items have changed?

Describe what you expected to happen:

When first enter the page , onViewableItemsChanged method will trigger without scroll event !

My code just like this:

const VIEWABILITY_CONFIG = {
    minimumViewTime: 300,
    viewAreaCoveragePercentThreshold: 10,
    waitForInteraction: false,
};
...

<FlatList
      ...
      horizontal={false}
      numColumns={2}
      renderItem={({ item, index }) => this.renderItem(item, index)}
      ItemSeparatorComponent={this.renderSeparator}
      ListFooterComponent={this.footerView}
      ListHeaderComponent={this.rederListHeader()}
      onViewableItemsChanged={this._onViewableItemsChanged}
      viewabilityConfig={VIEWABILITY_CONFIG} />

Please write soon, thanks !

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugComponent: FlatListStaleThere has been a lack of activity on this issue and it may be closed soon.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions