Display element in a grid and conditionally add to redux or remove if not selected
First of all, there's way too much going on here for an inline function. Let's seperate that out. Also, the splicing can be replaced with the more expressive filter.
const addIfMissing = (array, item) =&gt;
    array.includes(item) ? array : array.concat([item]);

const without = (array, exclude) =&gt;
    array.filter(x=&gt; x!==exclude);

const onGridSelectorChange = (categoryId, isSelected) =&gt; {
    favorites[categoryId] = isSelected;
    const categoryIds = Object.values(onboarding.favoriteCategories);
    const newCategoryIds = isSelected ?
        addIfMissing(categoryIds,categoryId) :
        without(categoryIds,categoryId);

    dispatchData({ [DATA_KEY.FAVORITE_CATEGORIES]: newCategoryIds})

}