I am trying to filter react table based on the default value which is passed into useTable . So, I have passed an array of json contained id and value into useTable, but it wasn't applied in the table. In fact, InitialState.filters just work for the first time, but after changing filterData, it isn't applied
const {
.....
preGlobalFilteredRows,
setGlobalFilter,
setAllFilters,
state: { pageIndex, pageSize, globalFilter },
} = useTable(
{
columns,
data,
defaultColumn,
...
autoResetSelectedRows: !skipReset,
disableMultiSort: true,
**initialState: {
pageSize: 10,
filters: filterData,
},**
},
useFilters,
useGroupBy,
useGlobalFilter,
useSortBy,
....,
);
filterData = [{id: "empId", value: "332697"}] But It doesn't apply in the table after rendering. Does it need other changes to apply default filtering?