How to set initial page size
Hellow, I'm trying to set initial page size to differnent value than 10.
If i'd try to do table.setPagesize(5) returning component it rerenders too many timez, can I put it somehow in the useReactTable object?
2 Replies
correct-apricotOP•3y ago
I just had moment of clarity and used useEffect but is there other way of doing it?
rare-sapphire•3y ago
I believe you can do this:
const table = useReactTable({
columns,
data,
initialState: {
pagination: {
pageSize: 25
}
},
getCoreRowModel: getCoreRowModel(),
getPaginationRowModel: getPaginationRowModel()
});