react-pagination-list
React component show the list with paging support
Install
Through npm
npm install react-pagination-list --save
Required
-
node >= 8.
-
npm >= 6.
-
react, react-dom >= 16.8.0.
Usage
ES6
;
ES5
const PaginationList = ;
Typescript
;
Props
data
data is a plain array
TYPE | REQUIRED | DEFAULT |
---|---|---|
array | yes | [] |
pageSize
Config of page size, hide it by setting it to undefined
pageSize=number
TYPE | REQUIRED | DEFAULT |
---|---|---|
number | no | undefined |
renderItem
Takes an item from data and renders it into the list.
;
TYPE | REQUIRED | DEFAULT |
---|---|---|
Function | yes | undefined |
- item (Object): The item from data being rendered.
- key (number): The index corresponding to this item in the data array.
Examples
import React Component from 'react';import PaginationList from 'react-pagination-list'; state = data: id: 1 name: "Johnson" id: 2 name: "David" id: 3 name: "Alice" { return <PaginationList = = = > }