React Table Default Sorting SortChoiceGQL Error

Viewed 25

I am trying to set default sorting for my react table but I am recieving an error:

Type '{ accessor: string; desc: true; }[]' is missing the following properties from type 'SortChoiceGQL': option, asc

Does anyone know how I can fix this? Below is the react hook I used.

const {
    getTableProps,
    getTableBodyProps,
    headerGroups,
    rows,
    prepareRow,
  } = useTable(
    {
      columns,
      data,
      initialState: {
        sortBy: [{
          accessor: 'column1',
          desc: true
        }]
      }
    },
    useSortBy,
  )
0 Answers
Related