Setting request timeout and error catching when using useDataGrid and useMany hook
I am using useDataGrid hook and useMany hook in this way:
const { dataGridProps} = useDataGrid({
sorters: {
mode: "off",
},
filters: {
mode: "off",
},
pagination: {
mode: "client",
},
});
const { data: testData, error: useManyError } = useMany({
resource: "test",
ids: dataGridProps?.rows?.map((item: any) => item?.id) ?? [],
queryOptions: {
enabled: !!dataGridProps?.rows,
},
});
I want to know how to set a timeout limit if the response takes too long to get back. Another thing is that I want to know how to catch the errors if there is an error in the connection with the backend
const { dataGridProps} = useDataGrid({
sorters: {
mode: "off",
},
filters: {
mode: "off",
},
pagination: {
mode: "client",
},
});
const { data: testData, error: useManyError } = useMany({
resource: "test",
ids: dataGridProps?.rows?.map((item: any) => item?.id) ?? [],
queryOptions: {
enabled: !!dataGridProps?.rows,
},
});
I want to know how to set a timeout limit if the response takes too long to get back. Another thing is that I want to know how to catch the errors if there is an error in the connection with the backend
