computerjazz / react-native-infinite-pager

An infinitely-swipeable pager component.
MIT License
174 stars 16 forks source link

how to use Pager as Lazy component. #7

Closed crzycoder closed 2 years ago

crzycoder commented 2 years ago

I want to use this infinity pager as a lazy component like wen view comes into visiable then the screen render

computerjazz commented 2 years ago

you can use either isActive boolean or listen to the focusAnim reanimated value to gate screen rendering: https://github.com/computerjazz/react-native-infinite-pager/blob/aa5a2d08743798a89a691eb2cd04fbabd781b8c8/src/index.tsx#L307-L308