react-crud-mobile 1.0.651 → 1.0.652

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.
@@ -1 +1,2 @@
1
- export declare function useIsVisible(ref: any): boolean;
1
+ import { Scope } from 'react-crud-utils';
2
+ export declare function useIsVisible(ref: any, scope: Scope): boolean;
@@ -670,8 +670,8 @@ var styles$6 = /*#__PURE__*/reactNative.StyleSheet.create({
670
670
  }
671
671
  });
672
672
 
673
- function useIsVisible(ref) {
674
- var _useState = React.useState(false),
673
+ function useIsVisible(ref, scope) {
674
+ var _useState = React.useState(scope.visible === true),
675
675
  isVisible = _useState[0],
676
676
  setIsVisible = _useState[1];
677
677
  React.useEffect(function () {
@@ -682,12 +682,14 @@ function useIsVisible(ref) {
682
682
  if (rect && typeof window !== 'undefined') {
683
683
  var windowHeight = window.innerHeight;
684
684
  var visible = rect.top < windowHeight && rect.bottom > 0;
685
+ scope.visible = visible;
685
686
  setIsVisible(visible);
686
687
  }
687
688
  } else {
688
689
  ref.current.measureInWindow == null || ref.current.measureInWindow(function (x, y, width, height) {
689
690
  var windowHeight = reactNative.Dimensions.get('window').height;
690
691
  var visible = y < windowHeight && y + height > 0;
692
+ scope.visible = visible;
691
693
  setIsVisible(visible);
692
694
  });
693
695
  }
@@ -723,7 +725,7 @@ function UIListRow(props) {
723
725
  }))),
724
726
  row = _useState[0];
725
727
  var targetRef = React.useRef(null);
726
- var isVisible = useIsVisible(targetRef);
728
+ var isVisible = useIsVisible(targetRef, scope);
727
729
  var onClick = function onClick(item) {
728
730
  row.call('click', {
729
731
  value: item,