1 min readFeb 11, 2019
Thanks for the great article here. Please correct me if I am wrong — Isn’t that calling api.fetchProfile(id) would always return a new reference to the function (anonymous) and would cause the effect to run unnecessarily every time it’s parent re-renders.
In my use case, I have to wrap my api call function — which returns a promise — with memoize to return a same reference. Is that ideal or am I missing something? Any help will be appreciated.