native-pytech 1.0.191 → 1.0.193

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.
@@ -2,6 +2,7 @@ declare const Hooks: {
2
2
  useEffectWithoutFirstRender: (effect: () => void, deps: any[]) => void;
3
3
  useLayoutEffectWithoutFirstRender: (effect: () => void, deps: any[]) => void;
4
4
  useAsyncEffect: (effect: (isMounted: () => boolean) => Promise<any>, deps: any[]) => void;
5
+ useAsyncEffectWithoutFirstRender: (effect: (isMounted: () => boolean) => Promise<any>, deps: any[]) => void;
5
6
  useAsyncFocusEffect: (effect: (isMounted: () => boolean) => Promise<any>) => void;
6
7
  useAsyncFocusEffectWithoutFirstRender: (effect: (isMounted: () => boolean) => Promise<any>) => void;
7
8
  };
@@ -28,6 +28,19 @@ const useAsyncEffect = (effect, deps) => {
28
28
  return () => { mounted = false; };
29
29
  }, deps);
30
30
  };
31
+ const useAsyncEffectWithoutFirstRender = (effect, deps) => {
32
+ const isFirstRender = useRef(true);
33
+ useEffect(() => {
34
+ if (isFirstRender.current) {
35
+ isFirstRender.current = false;
36
+ return;
37
+ }
38
+ let mounted = true;
39
+ const isMounted = () => mounted;
40
+ void effect(isMounted);
41
+ return () => { mounted = false; };
42
+ }, deps);
43
+ };
31
44
  const useAsyncFocusEffect = (effect) => {
32
45
  useFocusEffect(useCallback(() => {
33
46
  let mounted = true;
@@ -53,6 +66,7 @@ const Hooks = {
53
66
  useEffectWithoutFirstRender,
54
67
  useLayoutEffectWithoutFirstRender,
55
68
  useAsyncEffect,
69
+ useAsyncEffectWithoutFirstRender,
56
70
  useAsyncFocusEffect,
57
71
  useAsyncFocusEffectWithoutFirstRender,
58
72
  };
@@ -28,7 +28,7 @@ const AddTextView = memo(({ children, hasTextView }) => {
28
28
  export default memo(({ children, childrenLeft, childrenRight, onPress, style, backgroundColorPressed, LinearGradientProps, colorScheme, hasTextView, hasNavigationArrow = false, }) => {
29
29
  const content = <>
30
30
  {childrenLeft && <AddTextView hasTextView={hasTextView}>{childrenLeft}</AddTextView>}
31
- {childrenRight || hasNavigationArrow ? (<View style={styles.der}>
31
+ {childrenRight || hasNavigationArrow ? (<View style={[styles.der, !childrenLeft ? { flex: 1, paddingVertical: 16.35 } : {}]}>
32
32
  {childrenRight}
33
33
  {hasNavigationArrow && <Ionicons name='chevron-forward' size={20} color={colors.theme[colorScheme].icon}/>}
34
34
  </View>) : null}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "native-pytech",
3
- "version": "1.0.191",
3
+ "version": "1.0.193",
4
4
  "description": "Libreria de React Native Pytech",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",