React & Infinite Scroll - IntersectionObserver

preview_player
Показать описание
We'll use IntersectionObserver to build an infinite scrolling list which loads additional data when the user reaches the bottom of the list.

Рекомендации по теме
Комментарии
Автор

OMG thank you so much, all the other tutorial that I've read and the doc it self is really difficult to understand. Thank you for explaining this so well, I'm gonna share this to my friends.

manphamquang
Автор

Thank you, Leigh. I hope you hit a million subscribers one day because you deserve it

Daniel-wxwz
Автор

Leigh, thank you for sharing your knowledge! This video helped me to implement Infinite Scroll in my step project :)

dmytromoroz
Автор

I was nervous in the beginning when you showed the load more button, thinking that this is not with intersection observer xD. Great video dude, wish you the best! I subscribed, looking forward to more content from you! Many Thanks :D

ezwalduzumaki
Автор

Man, thank you so for such amazing tutorial. Nice reproducible example and clear explanation

MrJatan
Автор

you had a hard time with instantiation but at least the light did not shut down this time. Very interesting to see advanced use cases with useRef and how you solved the closure issue!

pierrickleroy
Автор

initialisation 👍


Thanks for this Leigh, I was doing it without useRef I'm going to try this way too

ScottSpencePlease
Автор

Thank you Leigh. I love your videos. Everything is explained so well!

psuprav
Автор

This is so cool. Thanks Leigh for another great video 🙂

dominikseljan
Автор

Hello Sir...this video was very informative and helped me solve an issue I was facing.. thank you

ashwiniravinair
Автор

Could you also tell how to update the count of the elements loaded ... ? i mean i can do it while scrolling down, but how to do it when scrolling up?

SofiaGoyal
Автор

Great stuff. However my gut is telling me that the useRef + useEffect combo can be rewritten with either useCallback or useMemo?

tianyidrinkmorewater
Автор

Hello!!! Thank you so much for great video and explication :).

tamaraevpraksina
Автор

Can you tell how to do this for reverse scroll? great video by the wayd

rajathongal
Автор

Hello, I am applying the observer in a project in react and typescript and when I assign the "ref" to the div I get an error. I think it is the setElement that is null. Would someone help me please = (

bryanmichaelzapatacapcha
Автор

Why not to change to increment page number and changed in state with that example it can be done rapidly

saidazkri
Автор

Hey I have a question, you are detting state again in return statement, means while rendering. React docs says we should avoid setting dtate in render method. As it will make infinite re-renders and app will crash, as setting state re-renders the component and after re-render we are just setting state. So why this is not crashing, or maybe I am missing something?

arjobansingh
Автор

Hi, I don't understand the part about when you do the assignment to ref: ref = {setElement}? :(

yadiracondezo
Автор

I think `observer` could be a simply memoized with useMemo. Where I go wrong?

mortezatourani
Автор

Hello Leigh, thank you for your amazing videos
I have a question can we wrap the load function in a useCallback hook instead of useRef?

ahrbil