I rarely comment on TH-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!
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
I rarely comment on TH-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 😊
Thank u!!! you really help me to much! i was looking this answer for a while!
I'm glad I could help 😄
Dude, Thanks for this tutorial. Straight to the point!
Glad I could help
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
Exactly what I needed. Thank you!
Np you're welcome
Thank you so much for this helpful video!
Glad it was helpful!
thanks mate I really appreciate this video
Np
Thank you bro
your video saved me
Thank you my brother
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
Hello! Great job! Thanks for sharing! Really useful!
Np
Nice tutorial,,this worked for me 👍👍
Glad you enjoyed it
Yeah,thanks
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
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!
dude thanks you saved me 😂😂😂
No worries broski
thats nice job . Thank you
Np
Thanks so much
Np
wow bro, thank you so much
Np
Thanks 👍
Np
thank you!
thabk you sir!
Thanks for help..sir
Np
@@arslan99 ❤❤❤❤
nice tuto my friend
Thank you I'm glad you enjoyed it
thanks!!!
Np
Gracias, muy útil (Thank you, very useful)
No worries glad I could help
Thanks man
Np glad I could help. Also your name is awesome man 👀
Perfect
Great ❤
شكرا
I love you.
Lmao glad I could help 😃
it worked 🫡