Let's Build a Swiggy Like Custom Carousel with Auto Scroll Auto Play in React Native 🔥

Поделиться
HTML-код
  • Опубликовано: 14 ноя 2024

Комментарии • 50

  • @KiranChuttugulla-u6j
    @KiranChuttugulla-u6j Год назад +3

    Can you share this code bro

    • @theawesomedev_
      @theawesomedev_  Год назад

      will provide soon

    • @theawesomedev_
      @theawesomedev_  Год назад +7

      here is it
      github.com/Prashantrajput11/custom-carousel

    • @lalithchakradhar2510
      @lalithchakradhar2510 5 месяцев назад

      @@theawesomedev_ thank you so much bro❤. Your code made my life easy. The React Native snap carousel and reanimated carousel was not working for me on my local machine.

  • @SolarSargodha
    @SolarSargodha 10 дней назад

    exactly what i was looking for

  • @electromorphous
    @electromorphous Год назад +6

    After doing scrollPosition / screenWidth I suggest doing Math.round(index), and then set the active index.

  • @imedhamdaoui1107
    @imedhamdaoui1107 6 месяцев назад +3

    nice work Bro, You can use Math.round(index), make the indicator react befor the user ends the scroll of the image (exactly in the half on scrolling the image
    )

  • @dave_an
    @dave_an 5 месяцев назад

    So easy to understand, thanks bro❤

  • @gauthamvijayan
    @gauthamvijayan 4 месяца назад

    Awesome work!

  • @SurajTopal-e6i
    @SurajTopal-e6i Год назад +1

    Thank you brother, Working fine. 🤩🤩🤩🤩🤩😍😍😍😍😍😍😍

  • @BirupakshaDey-we7st
    @BirupakshaDey-we7st 6 месяцев назад +1

    Good explanation

  • @djshadow-i1u
    @djshadow-i1u 26 дней назад

    awsome bro'

  • @okeypraisejunior7527
    @okeypraisejunior7527 5 месяцев назад +1

    God bless you!

  • @ezekielakintunde4816
    @ezekielakintunde4816 8 месяцев назад +1

    Thank you bro

  • @developerpranav
    @developerpranav Год назад

    I was looking for react, not react native, but beautiful work man!!

  • @tsuryaprakashreddy2245
    @tsuryaprakashreddy2245 6 месяцев назад

    awesome explanation

  • @fanziermuzic2087
    @fanziermuzic2087 Год назад

    Thank you brother 🎉, it's working fine 💖

  • @infernobot9188
    @infernobot9188 Год назад

    Thank you so much , works perfectly

  • @deveshtembheker1315
    @deveshtembheker1315 7 месяцев назад

    धन्यवाद गुरु ❤

  • @Legend_UP61
    @Legend_UP61 Год назад

    and es pr ek useMemo me bhi ek video bnaiye kyuki jo bahut sare api use honge es page pr to baar baar sb rerender hoga

  • @АлишерРизабаев-ш8ж

    Thank you very much

  • @shipalanaships9583
    @shipalanaships9583 8 месяцев назад

    Thanks bro

  • @ChakraofSoulA
    @ChakraofSoulA Год назад

    always i am getting this error "Invariant Violation: scrollToIndex out of range: requested index 11 is out of 0 to 2, js engine: hermes"

  • @BukkyOdunsi
    @BukkyOdunsi 8 месяцев назад

    Whats the clearInterval for?

  • @ambikarajkumar5472
    @ambikarajkumar5472 Год назад

    Thanks for the code,
    for android auto scrolling is working but it stops at the last image after that its not scrolling and in the dot indicator first dot only changing the color into green which means first image only mapping but for 2nd and 3rd image its not changing the color,
    please let me know where to
    correct it

    • @theawesomedev_
      @theawesomedev_  Год назад

      yes i noticed this too that it is not working for android but i have not figured the workaround out yet

    • @shahamaNew-cy6mk
      @shahamaNew-cy6mk Год назад

      useEffect(() => {
      let interval = setInterval(() => {
      if (activeIndex === carouselData.length - 1) {
      flatListRef.current.scrollToIndex({
      index: 0,
      animated: true,
      });
      setActiveIndex(0); // Reset the active index to 0
      } else {
      flatListRef.current.scrollToIndex({
      index: activeIndex + 1,
      animated: true,
      });
      setActiveIndex((prevIndex) => prevIndex + 1);
      }
      }, 2000);
      return () => clearInterval(interval);
      }, [activeIndex]); this will solve

  • @nqmgaming2004
    @nqmgaming2004 7 месяцев назад

    nice

  • @Legend_UP61
    @Legend_UP61 Год назад

    very very thanks sir, eske liye package download krna pdta tha ,but ek questiion hai mera , jaise apn like a tiktok scroll video bnate hai flatlist me to fast scroll krne pr multiple scroll ho jata hai , any solution ?

    • @theawesomedev_
      @theawesomedev_  Год назад +1

      have not tried bhai but will make a video on this as well! is par video jald hi 😇

  • @Legend_UP61
    @Legend_UP61 Год назад

    aur agar tik tok jaisa sroll bnana ho with full functionality to flatlist sahi rhega ya react-native-deck-swiper package

    • @theawesomedev_
      @theawesomedev_  Год назад +1

      depends apki preference kya hai , flatlist ka use karke aap sara control apne hath me le sakte to kaise bhi customise kar sakte ho V/S kisi external package ka use karke fast bna skte hi but control nhi raheta pura! at the end of the day ye ap par depend karta hai! baki you can try both

    • @Legend_UP61
      @Legend_UP61 Год назад

      @@theawesomedev_ thanks

    • @TheKurtaaGuy
      @TheKurtaaGuy 8 месяцев назад

      Bhaiya aap continue video dalo

  • @shankardakolia4912
    @shankardakolia4912 Год назад

    Sir I followed your video and created the project on IOS it works but in android auto scroll don't works and on manual scrolling only first image colour changes and the rest two doesn't

    • @theawesomedev_
      @theawesomedev_  Год назад

      Yes ! i just checked it out on android. Will soon find a fix and let you know. Thanks for pointing that out

    • @shankardakolia4912
      @shankardakolia4912 Год назад

      @@theawesomedev_ Thanks sir

    • @shahamaNew-cy6mk
      @shahamaNew-cy6mk Год назад

      heres the fix useEffect(() => {
      let interval = setInterval(() => {
      if (activeIndex === carouselData.length - 1) {
      flatListRef.current.scrollToIndex({
      index: 0,
      animated: true,
      });
      setActiveIndex(0); // Reset the active index to 0
      } else {
      flatListRef.current.scrollToIndex({
      index: activeIndex + 1,
      animated: true,
      });
      setActiveIndex((prevIndex) => prevIndex + 1);
      }
      }, 3000);
      return () => clearInterval(interval);
      }, [activeIndex]);

    • @mujahidali8691
      @mujahidali8691 4 месяца назад

      @@theawesomedev_ Sir aap kabh fix karonge because auto scroll it works only on ios but not on android and on manual scrolling only first dot colour changes and the rest two doesn't

  • @shahamaNew-cy6mk
    @shahamaNew-cy6mk Год назад +3

    If the auto-scroll stops at the last image here's the fix useEffect(() => {
    let interval = setInterval(() => {
    if (activeIndex === carouselData.length - 1) {
    flatListRef.current.scrollToIndex({
    index: 0,
    animated: true,
    });
    setActiveIndex(0); // Reset the active index to 0
    } else {
    flatListRef.current.scrollToIndex({
    index: activeIndex + 1,
    animated: true,
    });
    setActiveIndex((prevIndex) => prevIndex + 1);
    }
    }, 2000);
    return () => clearInterval(interval);
    }, [activeIndex]);

    • @Raghunadh9
      @Raghunadh9 7 месяцев назад

      Thank you so much bro, literally you saved my day 😊