T
TanStack3y ago
correct-apricot

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-apricot
correct-apricotOP3y ago
I just had moment of clarity and used useEffect but is there other way of doing it?
rare-sapphire
rare-sapphire3y ago
I believe you can do this: const table = useReactTable({ columns, data, initialState: { pagination: { pageSize: 25 } }, getCoreRowModel: getCoreRowModel(), getPaginationRowModel: getPaginationRowModel() });

Did you find this page helpful?