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.js CHANGED
@@ -787,17 +787,21 @@ const CustomLoader = ({ loading, loadingText = "Loading..." }) => {
787
787
  React.useEffect(() => {
788
788
  if (loading) {
789
789
  reactNative.Animated.loop(
790
- reactNative.Animated.parallel([
791
- reactNative.Animated.timing(rotateAnim, {
792
- toValue: 1,
793
- duration: 1500,
794
- easing: reactNative.Easing.linear,
795
- useNativeDriver: true
796
- })
797
- ])
790
+ reactNative.Animated.timing(rotateAnim, {
791
+ toValue: 1,
792
+ duration: 1500,
793
+ easing: reactNative.Easing.linear,
794
+ useNativeDriver: true
795
+ })
798
796
  ).start();
797
+ } else {
798
+ rotateAnim.stopAnimation();
799
+ rotateAnim.setValue(0);
799
800
  }
800
- }, [loading]);
801
+ return () => {
802
+ rotateAnim.stopAnimation();
803
+ };
804
+ }, [loading, rotateAnim]);
801
805
  if (!loading) return null;
802
806
  const spin = rotateAnim.interpolate({
803
807
  inputRange: [0, 1],