Closed alicanerdurmaz closed 1 hour ago
The return values of useTable related to pagination are as follows:
import { useTable } from "@refinedev/core"; const { current, setCurrent, pageSize, setPageSize, pageCount } = useTable();
The purpose of current and setCurrent is to change the page, but it is unclear what current refers to.
current
setCurrent
No response
useTable
page
setPage
pagination.page
pagination.current
dataProvider
syncWithLocation
useParsed
const { current, setCurrent, pageSize, setPageSize, pageCount } = useTable({ pagination: { page: 5, current: 5, }, });
After discussing this with the core team, we decided to implement it with Refine@5 because the syncWithLocation feature will cause a breaking change.
Is your feature request related to a problem? Please describe.
The return values of useTable related to pagination are as follows:
The purpose of
current
andsetCurrent
is to change the page, but it is unclear whatcurrent
refers to.Describe alternatives you've considered
No response
Additional context
No response
Describe the thing to improve
current
andsetCurrent
should be deprecated.useTable
should returnpage
andsetPage
, serving the same purpose.pagination.page
should be added touseTable
props, and ifpagination.page
is provided, it should overridepagination.current
.current
andpage
should be sent todataProvider
to prevent breaking changes.syncWithLocation
should work with both fields without breaking changes.useParsed
should work with both fields without breaking changes.