score:2

It may be a stale closure issue, could you try the following:

const getSelectedStatus = ({ key }) => {
  setData((data) => {
    const actionStatusId = key;
    const selectedFilters = {
      ...data.selectedFilters,
      actionStatusId,
    };
    return { ...data, selectedFilters };
  });
};
const getSelectedCategory = ({ key }) => {
  setData((data) => {
    const actionCategoryId = key;
    const selectedFilters = {
      ...data.selectedFilters,
      actionCategoryId,
    };
    return { ...data, selectedFilters };
  });
};

Related Query

More Query from same tag