score:1

usecallback will return a memoized version of the callback that only changes if one of the dependencies has changed

you simply do not require to use usecallback hook:

react.useeffect(() => {
    return () => {
      if (isloading) abortrequest();
    };
  }, [isloading]);

Related Query

More Query from same tag