We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Following this example Rendering <Datagrid> With A Custom Query will throw 2 errors if using sorting and pagination features.
<Datagrid>
sorting
pagination
setSort
<ListContextProvider value={{setSort: ...}} />
setPerPage
<Pagination setPerPage={...} />
It could be something like this:
const [perPage, setPerPage] = React.useState(25); // update here instead of const perPage = 50; const [sort, setSort] = React.useState({ field: "myfield", order: "DESC" }); ... <ListContextProvider value={{ basePath: "/expenses", data: keyBy(data, "id"), ids: data.map(({ id }) => id), currentSort: sort, selectedIds: [], setSort: (field, order) => { // update here setSort({ field, order }); }, }} > ... <Pagination page={page} perPage={perPage} setPage={setPage} setPerPage={setPerPage} // update here total={total} />
The text was updated successfully, but these errors were encountered:
Thanks for reporting. Can you open a PR ?
Sorry, something went wrong.
7108205
Sorry, I pushed the fix to master by mistake. Reopening.
Fix Datagrid requires too many props when used standalone
d44d7a7
Closes #6108
fzaninotto
Successfully merging a pull request may close this issue.
Following this example Rendering
<Datagrid>
With A Custom Query will throw 2 errors if usingsorting
andpagination
features.setSort
must be present inside<ListContextProvider value={{setSort: ...}} />
setPerPage
must be present inside<Pagination setPerPage={...} />
It could be something like this:
The text was updated successfully, but these errors were encountered: