Add refresh button to a list using mantine
I've added RefreshButton using headerButtons property of List component. It renders fine, but tapping on it does nothing. How can I make RefreshButton invalidate the list part of current resource?
RefreshButton to a list using Mantine and ensure it invalidates the list part of the current resource, you need to use the headerButtons property of the List component correctly. The RefreshButton should be configured to use the resource prop to specify which resource to refresh.RefreshButton is added to the headerButtons property of the List component.resource prop is set to "users" to specify which resource should be refreshed when the button is clicked.RefreshButton will trigger the useInvalidate hook and refresh the data for the "users" resource.RefreshButton component (https://refine.dev/docs/ui-integrations/mantine/components/buttons/refresh-button/#properties).RefreshButton to a list using Mantine and ensure it invalidates the list part of the current resource, you need to use the headerButtons property of the List component correctly. The RefreshButton should be configured to use the resource prop to specify which resource to refresh.RefreshButton is added to the headerButtons property of the List component.resource prop is set to "users" to specify which resource should be refreshed when the button is clicked.RefreshButton will trigger the useInvalidate hook and refresh the data for the "users" resource.RefreshButton component (https://refine.dev/docs/ui-integrations/mantine/components/buttons/refresh-button/#properties).RefreshButton to a list using Mantine and ensure it invalidates the list part of the current resource, you need to ensure that the RefreshButton is correctly configured to trigger the useInvalidate hook.RefreshButton is added to the headerButtons property of the List component.resource prop is set to "users" to specify which resource should be refreshed when the button is clicked.RefreshButton will trigger the useInvalidate hook and refresh the data for the "users" resource.RefreshButton component (https://refine.dev/docs/ui-integrations/mantine/components/buttons/refresh-button/#properties).RefreshButtonRefreshButtonRefreshButtonRefreshButtonRefreshButtonRefreshButtonRefreshButtonRefreshButtonRefreshButtonRefreshButtonRefreshButtonRefreshButtonRefreshButtonRefreshButtonRefreshButtonheaderButtonsheaderButtonsheaderButtonsheaderButtonsheaderButtonsListListListListList"users""users""users"import {
List,
useTable,
RefreshButton,
EditButton,
ShowButton,
DeleteButton,
} from "@refinedev/mantine";
import { Table } from "@mantine/core";
export const UserList: React.FC = () => {
const { tableProps } = useTable({
initialSorter: [{ field: "last_name", order: "asc" }],
syncWithLocation: true,
});
return (
<List
headerButtons={({ defaultButtons, refreshButtonProps }) => (
<>
{defaultButtons}
<RefreshButton {...refreshButtonProps} resource="users" />
</>
)}
>
<Table
{...tableProps}
rowKey="id"
pagination={{
pageSizeOptions: ["10", "20", "50", "100", "200"],
showSizeChanger: true,
total: tableProps.pagination.total,
current: tableProps.pagination.current,
pageSize: tableProps.pagination.pageSize,
}}
>
{/* Your table columns and rows here */}
</Table>
</List>
);
};import {
List,
useTable,
RefreshButton,
EditButton,
ShowButton,
DeleteButton,
} from "@refinedev/mantine";
import { Table } from "@mantine/core";
export const UserList: React.FC = () => {
const { tableProps } = useTable({
initialSorter: [{ field: "last_name", order: "asc" }],
syncWithLocation: true,
});
return (
<List
headerButtons={({ defaultButtons }) => (
<>
{defaultButtons}
<RefreshButton resource="users" />
</>
)}
>
<Table
{...tableProps}
rowKey="id"
pagination={{
pageSizeOptions: ["10", "20", "50", "100", "200"],
showSizeChanger: true,
total: tableProps.pagination.total,
current: tableProps.pagination.current,
pageSize: tableProps.pagination.pageSize,
}}
>
{/* Your table columns and rows here */}
</Table>
</List>
);
};import {
List,
useTable,
RefreshButton,
EditButton,
ShowButton,
DeleteButton,
} from "@refinedev/mantine";
import { Table } from "@mantine/core";
export const UserList: React.FC = () => {
const { tableProps } = useTable({
initialSorter: [{ field: "last_name", order: "asc" }],
syncWithLocation: true,
});
return (
<List
headerButtons={({ defaultButtons }) => (
<>
{defaultButtons}
<RefreshButton resource="users" />
</>
)}
>
<Table
{...tableProps}
rowKey="id"
pagination={{
pageSizeOptions: ["10", "20", "50", "100", "200"],
showSizeChanger: true,
total: tableProps.pagination.total,
current: tableProps.pagination.current,
pageSize: tableProps.pagination.pageSize,
}}
>
{/* Your table columns and rows here */}
</Table>
</List>
);
};