reactjs-scroll-pagination
v3.0.11
Published
<h1 align="center">Welcome to reactjs-scroll-pagination 👋</h1> <p> <a href="https://www.npmjs.com/package/reactjs-scroll-pagination" target="_blank"> <img alt="Version" src="https://img.shields.io/npm/v/reactjs-scroll-pagination.svg"> </a> <a h
Downloads
9
Readme
Install
npm install reactjs-scroll-pagination
Usage
The reactjs-scroll-pagination component provides a simple way to implement scroll pagination in React applications. Here's how you can use it:
import React, { useState } from 'react';
import ScrollPagination from 'reactjs-scroll-pagination';
const MyComponent = () => {
const [data, setData] = useState([1, 2, 3, 4, 5]);
const [hasMore, setHasMore] = useState(true);
const loadMore = () => {
// Fetch more data here...
// Update 'data' state and set 'hasMore' accordingly
};
return (
<div>
<ScrollPagination
loading="Loading more..."
loadMore={loadMore}
hasMore={hasMore}>
{
data.map((item) => (
<div key={item}>Item {item}</div>
))
}
</ScrollPagination>
</div>
);
};
export default MyComponent;
Author
- Website: https://tanmoy-paul.vercel.app
- Github: @tanmoypaul1005
Show your support
Give a ⭐️ if this project helped you!
📝 License
This project is ISC licensed.
This README was generated with ❤️ by readme-md-generator