React Infinite Scroll like YouTube, Instagram | with Animation

  Рет қаралды 22,672

Code Bless You

Code Bless You

Жыл бұрын

🤩Access the Full React Course - www.udemy.com/course/the-ulti...
🗒️MY FAVORITE TOOLS & GEARS
Height Adjustable Desk - amzn.to/42qPZkb
Old Desk in Budget - amzn.to/3UlaFbm
Favorite Laptop - amzn.to/3OrqmKa
LG Monitor for Productivity - amzn.to/3uqA5tv
Silent Keyboard(Loved It) - amzn.to/3UjagGv
Mouse & Keyboard Combo - amzn.to/3Sq50hs
Extra Large Mouse Pad - amzn.to/48Nhcjv
Sony Headphones - amzn.to/3HHjYed
Cheap Earphones for Editing - amzn.to/48eBykN
Daily Use Laptop Stand - amzn.to/3Uj8JQL
Mini Speakers for Consuming Content - amzn.to/48YgAaK
Mport X Connector - amzn.to/3UoHsML
Mic - amzn.to/48eCrtD
3 Color Lightbar - amzn.to/42qgaaW
Dual Monitor Stand - amzn.to/48Nixa1
Stop Watch for Productivity - amzn.to/3Un1RBW
Dotted Diary - amzn.to/3vYBWq1
🚀Access REDUX Course:- www.udemy.com/course/the-ulti...
How to apply infinite scroll in ReactJS or you can say endless scroll in React. Infinite scrolling is the most common feature to hook user attention on website content and user will spent more time on our website. You will learn How to add infinite scroll in react with loading animation very fast.
IMPORTANT LINKS
API LINK : api.coingecko.com/api/v3/coin...
Source Code : github.com/CodeBlessYou/Infin...
UseEffect Tutorial : • useEffect React Hook |...
Axios Tutorial : • Axios in React JS // C...
CSS Loader Tutorial: • 100+ Stunning CSS Load...
Social Media Links:
🚀COURSES : www.udemy.com/user/code-bless...
🤩INSTAGRAM : / code_blessyou
💙FACEBOOK : / 100077716056158
🐦TWITTER : / code_blessyou
😎LINKEDIN : / code-bless-you-5b76822b
COPYRIGHT FOOTAGE LINKS
Video by Anna Tarazevich: www.pexels.com/video/stressed...
Video by cottonbro: www.pexels.com/video/hands-ip...
Timer icons created by Pixel perfect - www.flaticon.com/free-icons/t...
TAGS
react pagination,lazy loading,react infinite scroll,infinite scroll react,infinite scroll,endless scroll react,react unlimited scroll,infinite scroll tutorial,react infinite scrolling,endless scrolling react,infinite scroll react tutorial,react infinite scroll component,react infinite scroll functional component,infinite scrolling with react,infinite scrolling,reactjs infinite scroll,infinite scroll reactjs,react,react infinite,react js
Infinite Scrolling With React - Tutorial Infinite Scroll React Example Using React-Infinite-Scroll-Component Infinite Scrolling in React | JavaScript Infinite Scrolling | Pagination in React JS in Hindi How to Code an Infinite Scroller with React Hooks

Пікірлер: 89
@CodeBlessYou
@CodeBlessYou Жыл бұрын
In this scrolling condition, at the bottom we by mistake sending multiple requests. So you can replace that logic with this, This will call our function only one time: useEffect(() => { window.addEventListener("scroll", handleScroll); return () => window.removeEventListener("scroll", handleScroll); }, []); const handleScroll = () => { const { scrollTop, clientHeight, scrollHeight } = document.documentElement; if (scrollTop + clientHeight >= scrollHeight) { setPage((prev) => prev + 1); } };
@canklc5772
@canklc5772 Жыл бұрын
For infinite scroll, I have watched several videos. This one is the best. No rocket science. Simple and on point. Thanks a lot Mate.
@CodeBlessYou
@CodeBlessYou Жыл бұрын
Thanks for this comment😇❤
@dannyng48
@dannyng48 Жыл бұрын
Yours is straightforward and didn't waste my time like the others, really appreciate.
@CodeBlessYou
@CodeBlessYou Жыл бұрын
Thank you man, I am grateful for this comment😇❤
@canklc5772
@canklc5772 Жыл бұрын
agree
@devworks8787
@devworks8787 6 ай бұрын
wow... very clean explanation and straight to the code. Subbed!
@CodeBlessYou
@CodeBlessYou 6 ай бұрын
Thank you so much❤❤❤
@LaFragas
@LaFragas Жыл бұрын
super fast and perfect, thank you!
@CodeBlessYou
@CodeBlessYou Жыл бұрын
Thank you so much for this comment❤
@abdelhakmehda
@abdelhakmehda Жыл бұрын
all your explanation are so clear ... you are amazing , keep going bro❤
@CodeBlessYou
@CodeBlessYou Жыл бұрын
Thanks brother😀
@quanganh2849
@quanganh2849 Жыл бұрын
Simple and on point. Tks a lot bro keep doing
@CodeBlessYou
@CodeBlessYou Жыл бұрын
Thanks for your support❤❤
@thesankharoy
@thesankharoy Жыл бұрын
All of your videos are really helpful to me. I learn a lot in very short time.
@CodeBlessYou
@CodeBlessYou Жыл бұрын
Thanks for your support. Grateful for that❤❤
@guesswho4633
@guesswho4633 Жыл бұрын
i really love your videos. helps a lot
@CodeBlessYou
@CodeBlessYou Жыл бұрын
Grateful for your support 😇❤
@fullycodedtech
@fullycodedtech Ай бұрын
I have seen many videos of more then 30 minutes to explain the same concept but you explained 1000 times better in just 7 minutes ❤
@CodeBlessYou
@CodeBlessYou Ай бұрын
Glad to here that❤❤❤
@rezafirouzabadi176
@rezafirouzabadi176 Жыл бұрын
thanks for the short and useful video brother
@CodeBlessYou
@CodeBlessYou Жыл бұрын
😇❤
@simple-stack-by-ed
@simple-stack-by-ed Ай бұрын
Straighter than an heterosexual alpha silverback man. Thx man!
@CodeBlessYou
@CodeBlessYou Ай бұрын
😅😅❤❤
@immanuelrajmohan830
@immanuelrajmohan830 Жыл бұрын
thank u bruh very short and simple
@CodeBlessYou
@CodeBlessYou Жыл бұрын
You're welcome!
@sauravkhanal
@sauravkhanal 2 ай бұрын
Really cool man, may the code bless you🖖
@CodeBlessYou
@CodeBlessYou 2 ай бұрын
Thanks, Same to you❤❤❤
@antrikshsingh2503
@antrikshsingh2503 Жыл бұрын
Well Explained :)
@CodeBlessYou
@CodeBlessYou Жыл бұрын
Thanks for Feedback😀
@sravanstg234
@sravanstg234 4 ай бұрын
Thank you for such simple explanation.
@CodeBlessYou
@CodeBlessYou 4 ай бұрын
❤❤❤
@francoagustin765
@francoagustin765 Жыл бұрын
Good tutorial, I haven't seen one like it. others had a lot of logic that when applying it I forgot everything. One thing that I would need is to verify that it does not look for more data if there is no next page.
@CodeBlessYou
@CodeBlessYou Жыл бұрын
For that you need to get total number of posts from your backend and after that you can do - ( totalPosts/postsPerPage ) This will return total number of page and then in codition, you have to put page
@vishnumurthyjadi4704
@vishnumurthyjadi4704 Жыл бұрын
I have watched several videos.your explanation excellent.thanks a lot . please do more videos on React.
@CodeBlessYou
@CodeBlessYou Жыл бұрын
Actually I am creating Complete React JS course, If you are interested then you can register for that. For first 100 Students it will completely FREE. Fill This Form:- forms.gle/aBtV1aRdcbztDwF3A
@dhruvkaravadiya3645
@dhruvkaravadiya3645 Жыл бұрын
amazing video bhai
@CodeBlessYou
@CodeBlessYou Жыл бұрын
Thank you brother❤
@sakibcoder
@sakibcoder 4 ай бұрын
great man
@CodeBlessYou
@CodeBlessYou 4 ай бұрын
❤❤❤
@giovankoulits8602
@giovankoulits8602 11 ай бұрын
Very helpful vid
@CodeBlessYou
@CodeBlessYou 11 ай бұрын
❤❤❤❤
@athulgeorge4873
@athulgeorge4873 Жыл бұрын
Great Tutorial, just wondering if we were to use a our own rest api, would we limit and offset to get the next data be ideal? Also how do we keep the loading animation for longer, setting the loading state to false within a setTimeout is not working for me.
@CodeBlessYou
@CodeBlessYou Жыл бұрын
Check setTimeout function if there are some error
@mylow_____
@mylow_____ Жыл бұрын
yeeeeessssss
@weverton.santiago
@weverton.santiago Жыл бұрын
Thanks new subs here
@CodeBlessYou
@CodeBlessYou Жыл бұрын
Thanks for subscribing😇❤
@muhammadfaizantariq7841
@muhammadfaizantariq7841 3 ай бұрын
Amazing Tutorial for infinite scroll with loading Really helpful
@CodeBlessYou
@CodeBlessYou 3 ай бұрын
❤❤❤
@muhammadfaizantariq7841
@muhammadfaizantariq7841 3 ай бұрын
@@CodeBlessYou , I'm facing issue when I reach the last product then api call is invoke and loading is keeping going so How I can avoid it, and one last thing on scroll event api call multiple time
@CodeBlessYou
@CodeBlessYou 3 ай бұрын
@@muhammadfaizantariq7841 Put condition, if isLoading is true then don't update page state
@Its_Abhi_Thakur
@Its_Abhi_Thakur Жыл бұрын
Thanks bro
@CodeBlessYou
@CodeBlessYou Жыл бұрын
Thanks for Feedback😀
@charankumarbasam5866
@charankumarbasam5866 Жыл бұрын
Good video.
@CodeBlessYou
@CodeBlessYou Жыл бұрын
Thanks😃
@pelumioye4196
@pelumioye4196 Жыл бұрын
hey man, wonderful tutorial but what do i do if i'm using my own server/backend and not a link that has "per_page and page=" ?
@CodeBlessYou
@CodeBlessYou Жыл бұрын
Then you have to create API which send posts by page number. When user reach to bottom of page, then you have to call API for that.
@r.vamsi-1657
@r.vamsi-1657 19 күн бұрын
when the scroll is in subcontainer of whole window, and if we want implement scroll in that container will this work?
@CodeBlessYou
@CodeBlessYou 18 күн бұрын
For that you have to track scroll for that container
@omarbarra3456
@omarbarra3456 Жыл бұрын
Thank very useful. question, why do not you use a Intersection Observer API? when shold we use eventListener or Intersection Observer API?
@CodeBlessYou
@CodeBlessYou Жыл бұрын
You can use both for infinite scrolling. This is the easy way to do that
@roycechriston5389
@roycechriston5389 2 ай бұрын
Thank you soo much If a get a job because of this you will be treated 😍😇
@CodeBlessYou
@CodeBlessYou 2 ай бұрын
Sure, All the best❤❤❤
@growwithdesign
@growwithdesign 11 ай бұрын
I have my own API file created in my react project, where I am manually maintaining records. How to use your own API file instead of using an external url?
@CodeBlessYou
@CodeBlessYou 11 ай бұрын
Sorry I don't have clear understanding about that
@mauriciochambi2508
@mauriciochambi2508 2 ай бұрын
How can I avoid data duplication in the first API call? I'm using Next.js
@CodeBlessYou
@CodeBlessYou 2 ай бұрын
You have to work with page number
@keerthanamalisetty7487
@keerthanamalisetty7487 Жыл бұрын
It would help if u show us how to do this with backend also with nodejs and mongodb
@CodeBlessYou
@CodeBlessYou Жыл бұрын
I will upload tutorial on that, If you want to try Right now then... Use limit and skip function in find method of mongoDB...
@anikbarua5483
@anikbarua5483 Жыл бұрын
Suppose i have my own json data that doesn't come from any api so how to add page number in this data?
@CodeBlessYou
@CodeBlessYou Жыл бұрын
In that case, you have to set two variables: currentPage=1 and postsPerPage=8, Now when you reach to bottom, then currentPage will 2 and you have to skip (currentPage - 1)*postsPerPage which is 8, so you have to skip 8 posts from your json data. If your currentPage is 3 then you have to skip first 16 posts from your json data. If you already have data offline in your application, then you don't need to add pagination or infinite scrolling. They are just for reducing the data load to server.
@jritzeku
@jritzeku Жыл бұрын
Any examples with Redux ? Also isn''t it bad to be making multiple network requests as you are here every 500ms?
@CodeBlessYou
@CodeBlessYou Жыл бұрын
I find that in this scrolling condition, at the bottom we by mistake sending multiple requests. So you can replace this logic with this, This will call our function only one time: useEffect(() => { window.addEventListener("scroll", handleScroll); return () => window.removeEventListener("scroll", handleScroll); }, []); const handleScroll = () => { const { scrollTop, clientHeight, scrollHeight } = document.documentElement; if (scrollTop + clientHeight >= scrollHeight) { setPage((prev) => prev + 1); } };
@Chavaka_cheap
@Chavaka_cheap Ай бұрын
@CodeBlessYou
@CodeBlessYou Ай бұрын
❤❤❤
@sandhyaginare857
@sandhyaginare857 Жыл бұрын
Can we do the same if we are getting the data from dummy json file?????
@CodeBlessYou
@CodeBlessYou Жыл бұрын
In that case, we don't want Infinite scrolling, we can simply display the data. Because Infinite scrolling essentially for reducing load to server for not sending 100posts in one request.
@alpalasaul
@alpalasaul 5 ай бұрын
What is that theme you use?
@CodeBlessYou
@CodeBlessYou 5 ай бұрын
AYU Dark❤❤
@vaibhavsingh6668
@vaibhavsingh6668 23 күн бұрын
Yes bro I have doubt in infinite loading in the couse i have purchase from udemy. React js 2024.
@CodeBlessYou
@CodeBlessYou 23 күн бұрын
Whats you doubt?
@vaibhavsingh6668
@vaibhavsingh6668 23 күн бұрын
@@CodeBlessYou can't implement infinite loading i am following your code along
@charankumarbasam5866
@charankumarbasam5866 Жыл бұрын
make a video on intersection observer
@CodeBlessYou
@CodeBlessYou Жыл бұрын
Sure😀
@AdityaSharan811
@AdityaSharan811 Жыл бұрын
U cannot make callback inside useEffect as async !!
@CodeBlessYou
@CodeBlessYou Жыл бұрын
Yes, You can declare async function outside of the useEffects and then call that function in useEffect
@anjalii1102
@anjalii1102 Жыл бұрын
are you gujarati
@CodeBlessYou
@CodeBlessYou Жыл бұрын
Yes😄😄 Did you notice that? You are good observer
Infinite Scrolling in React using Intersection Observer
29:35
Frontend Interview Pro
Рет қаралды 1,2 М.
Who has won ?? 😀 #shortvideo #lizzyisaeva
00:24
Lizzy Isaeva
Рет қаралды 46 МЛН
ОСКАР ИСПОРТИЛ ДЖОНИ ЖИЗНЬ 😢 @lenta_com
01:01
THEY WANTED TO TAKE ALL HIS GOODIES 🍫🥤🍟😂
00:17
OKUNJATA
Рет қаралды 21 МЛН
fikkyfook
8 8
Рет қаралды 9
Learn Intersection Observer In 15 Minutes
15:32
Web Dev Simplified
Рет қаралды 322 М.
Add Infinite Scrolling in React JS in Hindi 🔥
19:02
Thapa Technical
Рет қаралды 41 М.
React Pagination in 7 minutes [ EASY ] | Pagination Tutorial
7:40
Code Bless You
Рет қаралды 67 М.
Create an infinite horizontal scroll animation
32:01
Kevin Powell
Рет қаралды 182 М.
Building React Infinite Scroll with useInfiniteQuery
11:18
Monsterlessons Academy
Рет қаралды 10 М.
Infinite Scrolling With React - Tutorial
25:28
Web Dev Simplified
Рет қаралды 352 М.
Every React Concept Explained in 12 Minutes
11:53
Code Bootcamp
Рет қаралды 457 М.
Who has won ?? 😀 #shortvideo #lizzyisaeva
00:24
Lizzy Isaeva
Рет қаралды 46 МЛН