'_warnedAboutdividebyzero error inn Reactnative

I am getting this error when I am trying to add the slider animation in my home screen.The remarked code is which casuing this blunder Much appreciated inadvance.If I remark this codeit would work proerly with next to no sort of blunder.The commented code is which casuing this error.Thanks inadvance.If I comment this code would work properly without any kind of error.

  function renderDots() {
    const dotPosition = Animated.divide(newSeasonScrollX, SIZES.width);
    return (
      <View
        style={{
          marginTop: SIZES.padding,
          flexDirection: "row",
          justifyContent: "center",
          alignItems: "center",
        }}
      >
        {dummyData.newSeason.map((item, index) => {
          const opacity = dotPosition.interpolate({
            inputRange: [index - 1, index, index + 1],
            outputRange: [0.3, 1, 0.3],
            extrapolate: "clamp",
          });

          const dotWidth = dotPosition.interpolate({
            inputRange: [index - 1, index, index + 1],
            outputRange: [6, 20, 6],
            extrapolate: "clamp",
          });

          const dotColor = dotPosition.interpolate({
            inputRange: [index - 1, index, index + 1],
            outputRange: [COLORS.lightGray, COLORS.primary, COLORS.lightGray],
            extrapolate: "clamp",
          });

          return (
            <View
              // key={`dot-${index}`}
              // opacity={opacity}
              style={{
                borderRadius: SIZES.radius,
                marginHorizontal: 3,
                width: 6, //dotWidth
                height: 6,
                backgroundColor: COLORS.primary,  //dotColor

enter image description here



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source