Paul
Paul

Reputation: 4436

React native flatlist to know if I move to the left or to the right

I am using AppIntroSlider, but I would like to implement liquid effect in pagination dots.

In order to do this, I need to understand if the shift I am making is to the left or to the right.

I tried to use flatlist events like: onScrollBeginDrag and onScrollEndDrag, but they are not adequate to know.

How can I do?

Upvotes: 1

Views: 950

Answers (1)

Rajshekhar
Rajshekhar

Reputation: 614

You can try the below code <FlatList onScroll={(e) => console.log(e.nativeEvent.contentOffset.x)} .. it start from 0 so you can check that value and implement your logic.

Upvotes: 1

Related Questions