primereact 9.6.3 → 9.6.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -2939,7 +2939,6 @@ var useEventListener = function useEventListener(_ref) {
2939
2939
  when = _ref$when === void 0 ? true : _ref$when;
2940
2940
  var targetRef = React.useRef(null);
2941
2941
  var listenerRef = React.useRef(null);
2942
- var prevListener = usePrevious(listener);
2943
2942
  var prevOptions = usePrevious(options);
2944
2943
  var bind = function bind() {
2945
2944
  var bindOptions = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
@@ -2969,12 +2968,11 @@ var useEventListener = function useEventListener(_ref) {
2969
2968
  }
2970
2969
  }, [target, when]);
2971
2970
  React.useEffect(function () {
2972
- // to properly compare functions we can implicitly converting the function to it's body's text as a String
2973
- if (listenerRef.current && ('' + prevListener !== '' + listener || prevOptions !== options)) {
2971
+ if (listenerRef.current && (listenerRef.current !== listener || prevOptions !== options)) {
2974
2972
  unbind();
2975
2973
  when && bind();
2976
2974
  }
2977
- }, [listener, options, when]);
2975
+ }, [listener, options]);
2978
2976
  useUnmountEffect(function () {
2979
2977
  unbind();
2980
2978
  });