
Security News
rv Is a New Rust-Powered Ruby Version Manager Inspired by Python's uv
Ruby maintainers from Bundler and rbenv teams are building rv to bring Python uv's speed and unified tooling approach to Ruby development.
react-native-use-infinite-scrolling
Advanced tools
A react native package for infinite scrolling of list
A react native package developed to implement infinite scrolling in any react-native app.
Install via npm
npm i react-native-use-infinite-scrolling
Install via YARN
yarn add react-native-use-infinite-scrolling
Import the InfiniteScroll component from react-native-use-infinite-scrolling:
import InfiniteScroll from 'react-native-use-infinite-scrolling'
This component accepts 4 parameters / props:
import React, {useState} from "react";
import { View, Text } from "react-native";
import {ListItem} from 'native-base';
import axios from 'axios';
import InfiniteScroll from 'react-native-use-infinite-scrolling';
const ExampleInfiniteScroll = () => {
const [incidents, setIncidents] = useState([]);
const [total, setTotal] = useState(0);
const [loading, setLoading] = useState(false);
const [page, setPage] = useState(1);
const perPage = 10;
const url = 'https://api.punkapi.com/v2/beers'; // this is a public api
const renderItem = ({item}) => {
return (
<ListItem>
<Text style={{color: 'red'}}>{item.description}</Text>
</ListItem>
);
};
const loadIncidents = async () => {
try {
setLoading(true);
const response = await axios.get(`${url}?page=${page}&per_page=${perPage}`);
setIncidents([...incidents, ...response.data]);
setPage(page + 1);
} catch (error) {
console.log(error);
} finally {
setLoading(false)
}
}
return (
<View>
<InfiniteScroll
loading={loading}
loadingText="Loading..."
data={incidents}
renderItem={renderItem}
onLoadMore={loadIncidents} />
</View>
);
};
export default ExampleInfiniteScroll;
FAQs
A react native package for infinite scrolling of list
We found that react-native-use-infinite-scrolling demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 3 open source maintainers 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.
Security News
Ruby maintainers from Bundler and rbenv teams are building rv to bring Python uv's speed and unified tooling approach to Ruby development.
Security News
Following last week’s supply chain attack, Nx published findings on the GitHub Actions exploit and moved npm publishing to Trusted Publishers.
Security News
AGENTS.md is a fast-growing open format giving AI coding agents a shared, predictable way to understand project setup, style, and workflows.