react-crud-mobile 1.0.643 → 1.0.644

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.
@@ -692,6 +692,20 @@ function UIListRow(props) {
692
692
  data: item
693
693
  }))),
694
694
  row = _useState[0];
695
+ var viewRef = React.useRef(null);
696
+ var _useState2 = React.useState(false),
697
+ visible = _useState2[0],
698
+ setVisible = _useState2[1];
699
+ var windowHeight = reactNative.Dimensions.get('window').height;
700
+ var checkIfVisible = function checkIfVisible() {
701
+ var nodeHandle = reactNative.findNodeHandle(viewRef.current);
702
+ if (nodeHandle && !visible) {
703
+ reactNative.UIManager.measure(nodeHandle, function (x, y, width, height, pageX, pageY) {
704
+ var isVisible = pageY >= 0 && pageY + height <= windowHeight;
705
+ setVisible(isVisible);
706
+ });
707
+ }
708
+ };
695
709
  var onClick = function onClick(item) {
696
710
  row.call('click', {
697
711
  value: item,
@@ -701,24 +715,10 @@ function UIListRow(props) {
701
715
  });
702
716
  };
703
717
  var ListItem = function ListItem() {
704
- var _useState2 = React.useState(0),
705
- updateIndex = _useState2[0],
706
- setUpdateIndex = _useState2[1];
718
+ var _useState3 = React.useState(0),
719
+ updateIndex = _useState3[0],
720
+ setUpdateIndex = _useState3[1];
707
721
  var key = scope.key('item');
708
- var viewRef = React.useRef(null);
709
- var _useState3 = React.useState(false),
710
- visible = _useState3[0],
711
- setVisible = _useState3[1];
712
- var windowHeight = reactNative.Dimensions.get('window').height;
713
- var checkIfVisible = function checkIfVisible() {
714
- var nodeHandle = reactNative.findNodeHandle(viewRef.current);
715
- if (nodeHandle && !visible) {
716
- reactNative.UIManager.measure(nodeHandle, function (x, y, width, height, pageX, pageY) {
717
- var isVisible = pageY >= 0 && pageY + height <= windowHeight;
718
- setVisible(isVisible);
719
- });
720
- }
721
- };
722
722
  var getRowStyle = function getRowStyle() {
723
723
  var css = row.getStyle('row', _extends({}, styles.row));
724
724
  if (cols > 0) {