Have an error when use custom function

hi!
when i get a custom function from a component i get this error. what could be the reason?

this is a function

const useClickHandler = (onClick) => {
  const tracking = useDi(ANALYTICS_TOKEN);
  const showOnboardingPopup = useOnboardingPopupTrigger();
  const isMobileContent = useIsMobileContent();

  const handleClick = useCallback((e) => {
    tracking.event(EVENT_ACQUISITION_BTN_CLICK, { asLink: true });

    if (!isMobileContent) {
      e.preventDefault();
      e.stopPropagation();
      showOnboardingPopup && showOnboardingPopup();
    }

    onClick && onClick();
  }, [onClick]);
  
  return handleClick;
};

this is an error

[ReferenceError: event is not defined]

why is this happening?

Hi @vivid.money, I need more context to be able to investigate here. Can you create a small reproduction of your issue in Codesandbox and share it so we can look into it?