Research
Security News
Malicious npm Package Targets Solana Developers and Hijacks Funds
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
react-native-bidirectional-infinite-scroll
Advanced tools
Birectional infinite scroll for react-native
Implement bidirectional infinite smooth scroll using React Native
[ Built with ♥ at Stream ]
https://dev.to/vishalnarkhede/react-native-how-to-build-bidirectional-infinite-scroll-32ph
FlatList by react-native only allows infinite scroll in one direction (using onEndReached
). This package adds capability on top of FlatList to allow infinite scroll from both directions, and also maintains smooth scroll UX.
onStartReached
& onEndReached
, which you can use to load more results.iOS | Android |
yarn add react-native-bidirectional-infinite-scroll @stream-io/flat-list-mvcp
Please check the example app for working demo.
import { FlatList } from "react-native-bidirectional-infinite-scroll";
<FlatList
data={numbers}
renderItem={ListItem}
keyExtractor={(item) => item.toString()}
onStartReached={onStartReached} // required, should return a promise
onEndReached={onEndReached} // required, should return a promise
showDefaultLoadingIndicators={true} // optional
onStartReachedThreshold={10} // optional
onEndReachedThreshold={10} // optional
activityIndicatorColor={'black'} // optional
HeaderLoadingIndicator={() => { /** Your loading indicator */ }} // optional
FooterLoadingIndicator={() => { /** Your loading indicator */ }} // optional
enableAutoscrollToTop={false} // optional | default - false
// You can use any other prop on react-native's FlatList
/>
Note:
onEndReached
and onStartReached
only get called once, per content length.onEndReached
and onStartReached
must return a promise.maintainVisibleContentPosition
is fixed, and can't be modified through props.ListFooterComponent
via prop, since it is occupied by FooterLoadingIndicator
See the contributing guide to learn how to contribute to the repository and the development workflow.
MIT
FAQs
Birectional infinite scroll for react-native
The npm package react-native-bidirectional-infinite-scroll receives a total of 1,393 weekly downloads. As such, react-native-bidirectional-infinite-scroll popularity was classified as popular.
We found that react-native-bidirectional-infinite-scroll demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
Security News
Research
Socket researchers have discovered malicious npm packages targeting crypto developers, stealing credentials and wallet data using spyware delivered through typosquats of popular cryptographic libraries.
Security News
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.