react / react/react-native

Changing onViewableItemsChanged on the fly is not supported

Open
#30,171 45 comments 7 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Bug Component: FlatList Never gets stale Resolution: Backlog Tech: React Native Core
Dominant language
C++
Stars
127k
Forks
25.3k
Avg merge
1d 23h
Merged PRs (30d)
4

Description

Please provide all the information requested. Issues that do not follow this format are likely to stall.

Description

Changing onViewableItemsChanged on the fly is not supported

React Native version:

0.63.3

Snack, code example, screenshot, or link to a repository:

<FlatList
ref={FlatListRef}
data={data}
inverted={true}
contentContainerStyle={{
flexGrow: 1, justifyContent: 'flex-end',
}}
renderItem={renderItem}
keyExtractor={item => item.id}
viewabilityConfig={{waitForInteraction: true, viewAreaCoveragePercentThreshold: 95}}
onViewableItemsChanged={(info) => {
console.log(info)
}}
/>

image

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the supplied FlatList example with inverted data, the shown viewabilityConfig, and onViewableItemsChanged. Investigate how changing that callback on the fly is handled and compare the behavior with the reported unsupported-change message. Done means the callback can be changed as intended, or the supported behavior and limitation are clearly documented.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, react-native
Domain
mobile
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.