Answers for "Changing onViewableItemsChanged on the fly is not supported"

0

Changing onViewableItemsChanged on the fly is not supported

onst onViewRef = React.useRef((viewableItems)=> {
      console.log(viewableItems)
      // Use viewable items in state or as intended
  })
  const viewConfigRef = React.useRef({ viewAreaCoveragePercentThreshold: 50 })


<FlatList
      horizontal={true}
      onViewableItemsChanged={onViewRef.current}
      data={Object.keys(cards)}
      keyExtractor={(_, index) => index.toString()}
      viewabilityConfig={viewConfigRef.current}
      renderItem={({ item, index }) => { ... }}
/>
Posted by: Guest on August-20-2021

Code answers related to "Changing onViewableItemsChanged on the fly is not supported"

Browse Popular Code Answers by Language