Kaynağa Gözat

Merge branch 'release/1.5.0-pre-alpha.7'

lfabl 1 hafta önce
ebeveyn
işleme
d9499ab098

+ 1 - 1
package.json

@@ -1,6 +1,6 @@
 {
     "name": "ncore-ui-kit",
-    "version": "1.5.0-pre-alpha.6",
+    "version": "1.5.0-pre-alpha.7",
     "description": "NİBGAT® | NCore - UI Kit for React-Native Mobile Apps.",
     "main": "./lib/module/index.js",
     "types": "./lib/typescript/src/index.d.ts",

+ 9 - 1
src/components/snackBar/index.tsx

@@ -113,6 +113,8 @@ const SnackBar: FC<ISnackBarProps> = ({
     });
 
     useEffect(() => {
+        let timeout: NodeJS.Timeout;
+
         if(isMeasured) {
             transformAnim.setValue(-contentHeight.current + -top + -spaces.spacingSm);
 
@@ -131,10 +133,16 @@ const SnackBar: FC<ISnackBarProps> = ({
                 })
             ]).start();
 
-            setTimeout(() => {
+            timeout = setTimeout(() => {
                 closeAnimation();
             }, autoCloseDelay);
         }
+
+        return () => {
+            if(timeout) {
+                clearTimeout(timeout);
+            }
+        };
     }, [
         isMeasured
     ]);

+ 5 - 1
src/components/toast/index.tsx

@@ -108,9 +108,13 @@ const Toast: FC<IToastProps> = ({
             })
         ]).start();
 
-        setTimeout(() => {
+        const timeout = setTimeout(() => {
             closeAnimation();
         }, autoCloseDelay);
+
+        return () => {
+            clearTimeout(timeout);
+        };
     }, []);
 
     const closeAnimation = (_onClosed?: (props: {

+ 2 - 3
src/helpers/portalize/Manager.tsx

@@ -60,10 +60,9 @@ export const Manager = forwardRef(({
             {
                 children,
                 key
-            },
-            index: number
+            }
         ) => <View
-            key={`NCoreUIKit-Portal-${key}-${index}`}
+            key={`NCoreUIKit-Portal-${key}`}
             style={[
                 StyleSheet.absoluteFill
             ]}