@@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.
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 )
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
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 ?
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
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_ 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
Can you share this code bro
will provide soon
here is it
github.com/Prashantrajput11/custom-carousel
@@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.
exactly what i was looking for
After doing scrollPosition / screenWidth I suggest doing Math.round(index), and then set the active index.
Thanks For suggestion
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
)
So easy to understand, thanks bro❤
Awesome work!
Thank you brother, Working fine. 🤩🤩🤩🤩🤩😍😍😍😍😍😍😍
Good explanation
awsome bro'
God bless you!
thank you 😊😇
Thank you bro
most welcome 🤗
I was looking for react, not react native, but beautiful work man!!
glad you liked it
awesome explanation
Glad you liked it
Thank you brother 🎉, it's working fine 💖
Thank you so much , works perfectly
Glad it helped
धन्यवाद गुरु ❤
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
Thank you very much
😇❤️💫
Thanks bro
always i am getting this error "Invariant Violation: scrollToIndex out of range: requested index 11 is out of 0 to 2, js engine: hermes"
Whats the clearInterval for?
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
yes i noticed this too that it is not working for android but i have not figured the workaround out yet
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
nice
thank you 😊
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 ?
have not tried bhai but will make a video on this as well! is par video jald hi 😇
aur agar tik tok jaisa sroll bnana ho with full functionality to flatlist sahi rhega ya react-native-deck-swiper package
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
@@theawesomedev_ thanks
Bhaiya aap continue video dalo
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
Yes ! i just checked it out on android. Will soon find a fix and let you know. Thanks for pointing that out
@@theawesomedev_ Thanks sir
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]);
@@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
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]);
Thank you so much bro, literally you saved my day 😊