I find the index number of the element, change a value in that index in order not to break the order in the array, dispatch it as a new array but subscribed components are not rendered.
var userPhotoIndex = userPhotos.findIndex(p => p.photoId === photoId)
if (userPhotoIndex > -1) {
userPhotos[userPhotoIndex].likeCount -= 1;
dispatch(getUserPhotosSuccess([...userPhotos]))
}
Source: Ask Javascript Questions