This is how I am trying to implement url searchparams for date filtering is it a good way? Will greatly appreciate any feedback. I am using shadcn as base for setting up advanced table

I am using latest [email protected]


"use client"
React.useEffect(() => {
    const dateUpdated = searchParams.get("date_updated");
    console.log('dateUpdated', dateUpdated)
    if (dateUpdated) {
      table.getColumn("date_updated")?.setFilterValue(dateUpdated);
    }
}, [searchParams.get("date_updated")]);

The above snippet is partof my date table component which am calling from server component page.tsx

I want to know is this a good way of implementing the filtering or am I doing it wrong?

0

There are 0 best solutions below