T
TanStack3y ago
absent-sapphire

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
absent-sapphire
absent-sapphireOP3y ago
I just had moment of clarity and used useEffect but is there other way of doing it?
correct-apricot
correct-apricot3y 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?