Scroll to Top of Page in React
Вставка
- Опубліковано 4 жов 2024
- What's up, in this video we'll learn how to create a scroll back to top button in React. As always if this video helps be sure to like and subscribe :D
Git Repo:github.com/ars...
Futurama Lorem Ipsum: fillerama.io/
Please don't forget Like, Comment and Subscribe if you're new! Support the channel 😁: www.paypal.com...
I rarely comment on UA-cam, but I was searching for how to build a "goTop" function in React, and I came across your tutorial. It was clear, concise, and pretty easy to follow. Thanks for making this video. Thanks a lot!
I'm really glad in could help you out 😊
Dude, Thanks for this tutorial. Straight to the point!
Glad I could help
Thank u!!! you really help me to much! i was looking this answer for a while!
I'm glad I could help 😄
Exactly what I needed. Thank you!
Np you're welcome
Thank you my brother
Np
Thank you so much for this helpful video!
Glad it was helpful!
Thank you bro
your video saved me
thanks mate I really appreciate this video
Np
TYSM!
Np
thank you!
thabk you sir!
brother i have question that is window dom object? if yes then react don't recommend to do something with window object directly. Please reply.
I'm sorry I don't quite understand your question can you please elaborate
thats nice job . Thank you
Np
Hello! Great job! Thanks for sharing! Really useful!
Np
Thanks, it's really very helpful.👍
Glad you liked it 😃
window.scrollTo() is not working
There could've been a typo you might've Typed scrollto
wow bro, thank you so much
Np
Good tutorial, thank you so much!
Of course, you're welcome I'm glad you enjoyed it
😊thank you sir ,very nice
Glad I could help
dude thanks you saved me 😂😂😂
No worries broski
Thanks so much
Np
Nice tutorial,,this worked for me 👍👍
Glad you enjoyed it
Yeah,thanks
Perfect
thanks!!!
Np
Thanks for help..sir
Np
@@arslan99 ❤❤❤❤
Thanks 👍
Np
Gracias, muy útil (Thank you, very useful)
No worries glad I could help
nice tuto my friend
Thank you I'm glad you enjoyed it
Thanks man
Np glad I could help. Also your name is awesome man 👀
شكرا
Great ❤
I love you.
Lmao glad I could help 😃
Hi, i added this to a project im working on and this works for me, however I get a warning:
react_devtools_backend.js:3973 Warning: Can't perform a React state update on an unmounted component. This is a no-op, but it indicates a memory leak in your application. To fix, cancel all subscriptions and asynchronous tasks in a useEffect cleanup function.
I added a cleanup function to the bottom of my useEffect to remove the event listener, but the warning is still there:
useEffect(() => {
window.addEventListener("scroll", () => {
window.scrollY > 100 ? setToTop(true) : setToTop(false);
})
return () => {
window.removeEventListener("scroll", () => {
window.scrollY > 100 ? setToTop(true) : setToTop(false);
});
}
}, []);
Sorry without looking at the actual code This article should help. Oh also could it be your using async in your project but haven't used it in your useeffect?
stackoverflow.com/questions/53949393/cant-perform-a-react-state-update-on-an-unmounted-component#56537704
@@arslan99 I'll checkout out that stack overflow article, thank you!
it worked 🫡