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.
package/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "1.0.643",
2
+ "version": "1.0.644",
3
3
  "license": "MIT",
4
4
  "description": "Uma biblioteca de componentes para React Native",
5
5
  "main": "dist/index.js",
@@ -38,6 +38,20 @@ export default function UIListRow(props: UIListRowType) {
38
38
  })
39
39
  );
40
40
 
41
+ const viewRef = useRef(null);
42
+ const [visible, setVisible] = useState(false);
43
+ const windowHeight = Dimensions.get('window').height;
44
+ const checkIfVisible = () => {
45
+ const nodeHandle = findNodeHandle(viewRef.current);
46
+
47
+ if (nodeHandle && !visible) {
48
+ UIManager.measure(nodeHandle, (x, y, width, height, pageX, pageY) => {
49
+ const isVisible = pageY >= 0 && pageY + height <= windowHeight;
50
+ setVisible(isVisible);
51
+ });
52
+ }
53
+ };
54
+
41
55
  const onClick = (item: any) => {
42
56
  row.call('click', { value: item, item, edit: true, index });
43
57
  };
@@ -45,19 +59,6 @@ export default function UIListRow(props: UIListRowType) {
45
59
  const ListItem = () => {
46
60
  let [updateIndex, setUpdateIndex] = useState(0);
47
61
  let key = scope.key('item');
48
- const viewRef = useRef(null);
49
- const [visible, setVisible] = useState(false);
50
- const windowHeight = Dimensions.get('window').height;
51
- const checkIfVisible = () => {
52
- const nodeHandle = findNodeHandle(viewRef.current);
53
-
54
- if (nodeHandle && !visible) {
55
- UIManager.measure(nodeHandle, (x, y, width, height, pageX, pageY) => {
56
- const isVisible = pageY >= 0 && pageY + height <= windowHeight;
57
- setVisible(isVisible);
58
- });
59
- }
60
- };
61
62
 
62
63
  const getRowStyle = () => {
63
64
  let css = row.getStyle('row', { ...styles.row });