dhre-ui-kit 0.0.237 → 0.0.238

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/lib/index.mjs CHANGED
@@ -751,17 +751,21 @@ const CustomLoader = ({ loading, loadingText = "Loading..." }) => {
751
751
  useEffect(() => {
752
752
  if (loading) {
753
753
  Animated.loop(
754
- Animated.parallel([
755
- Animated.timing(rotateAnim, {
756
- toValue: 1,
757
- duration: 1500,
758
- easing: Easing.linear,
759
- useNativeDriver: true
760
- })
761
- ])
754
+ Animated.timing(rotateAnim, {
755
+ toValue: 1,
756
+ duration: 1500,
757
+ easing: Easing.linear,
758
+ useNativeDriver: true
759
+ })
762
760
  ).start();
761
+ } else {
762
+ rotateAnim.stopAnimation();
763
+ rotateAnim.setValue(0);
763
764
  }
764
- }, [loading]);
765
+ return () => {
766
+ rotateAnim.stopAnimation();
767
+ };
768
+ }, [loading, rotateAnim]);
765
769
  if (!loading) return null;
766
770
  const spin = rotateAnim.interpolate({
767
771
  inputRange: [0, 1],