dead-brownD
Refine2y ago
15 replies
dead-brown

Filtering with useList and state operation

Hi guys, I currently have a List with useList to get data from a table with supabase
Now I have a button and a state value to change the filter when click the button.
Here is a useList code
const { data, isLoading } = useList<IPlan, HttpError>({
    resource: "plans",
    filters: [
      {
        field: "status",
        operator: "eq",
        value: statusFilter,
      },
    ],
  });

I want when first load, the List will show all the data from DB table (ignore the filter, the filter will trigger when statusFilter change), how can I do that?
Was this page helpful?