TanStackT
TanStack2y ago
3 replies
brilliant-lime

Should the initial sorting state include the unsorted option

Hi : D

I'm trying to control the initial state of a table with query params in a NextJS project. I can control the page and the rows per page no problem with query params passed in as props with default value fallbacks but something like this:

      sorting: [
        {
          id: "title",
          desc: searchParams.titleSort === "desc",
        },
      ],

Isn't flexible enough because it constrians the sorting state of the title column to either desc or asc. If the query param for this column isn't defined I'd rather this column remain unsorted.

Am I thinking about this problem correctly?
Was this page helpful?