React component paginator
npm install --save bsr-paginator
import {useEffect, useRef, useState} from "react";
import {Paginator} from 'bsr-paginator'
import 'bsr-paginator/dist/index.css'
export function App() {
const [myState, setMyState] = useState('');
const refPaginator = useRef<Paginator>(null)
useEffect(() => {
/*fetching SetState(totalRows, pageSize,currentPage)*/
refPaginator.current!.SetState(500, 10, 1)
}, [])
return (
<div>
<div>{myState}</div>
<Paginator
range={10}
ref={refPaginator}
previous={'<'}
next={'>'}
first={'<<'}
last={'>>'}
onChange={(page) => {
setMyState(page + " page of " + refPaginator.current!.State.PagesCount)
}}
/>
</div>
)
}
MIT © ionson100