I have parent component A from where I am fetching TODO list (lets say 10 item), then mapping this array and passing whole object to component B.
Component B has a memo wrapper to compare todo object references to re-render only updated component. Sth like:
export default memo(ComponentB, (prevProps, nextProps) => { return prevProps.TODO === nextProps.TODO })From component B on button click call useMutation to add one item inside list. I provided optimisticResponse and update function as it was on Apollo doc
Everything is working fine except: When I am adding optimisticResponse for fast UI change and log inside component B, I see that every list item is re-rendering, BUT in case I just leave update function without optimisticResponse then I see that only one item re-rendered.
So my question is, is this how Apollo treats optimisticResponse update or I should continue looking for some issue in my code and I am trying to figure out hours already :/
I just couldn't found any material yet which points out this particular case and if someone knows answer, maybe share the link or small suggestion. Thank you!