Quantcast
Channel: Active questions tagged react-native+typescript - Stack Overflow
Viewing all articles
Browse latest Browse all 6287

How do you test onviewableitemschanged in SectionList?

$
0
0

I have a component that tracks which section of a section list is visible and updates the "active" state based on the visibility of the section.

What I am trying to do is increase the code coverage of Jest to when the visibility does change.

I already have a

useEffect( ()=> { sectionListRef.current?.recordInteraction() } )

To force the onViewableItemsChanged to be called for the initial visible list. However, I don't see the lines being covered by jest --coverage


Viewing all articles
Browse latest Browse all 6287

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>