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...

КОМЕНТАРІ • 64

  • @userBC-usd
    @userBC-usd 7 місяців тому +2

    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!

    • @arslan99
      @arslan99  7 місяців тому

      I'm really glad in could help you out 😊

  • @archangel4894
    @archangel4894 Рік тому +3

    Dude, Thanks for this tutorial. Straight to the point!

  • @maxalejandrocamacho6163
    @maxalejandrocamacho6163 5 місяців тому +1

    Thank u!!! you really help me to much! i was looking this answer for a while!

    • @arslan99
      @arslan99  5 місяців тому

      I'm glad I could help 😄

  • @synbonghitshomie
    @synbonghitshomie 2 роки тому +3

    Exactly what I needed. Thank you!

    • @arslan99
      @arslan99  2 роки тому +1

      Np you're welcome

  • @thelearner3962
    @thelearner3962 10 місяців тому +1

    Thank you my brother

  • @MTran-r8c
    @MTran-r8c 6 місяців тому +1

    Thank you so much for this helpful video!

    • @arslan99
      @arslan99  6 місяців тому +1

      Glad it was helpful!

  • @Dilrux19
    @Dilrux19 Рік тому +1

    Thank you bro
    your video saved me

  • @elgalanazo1662
    @elgalanazo1662 11 місяців тому +1

    thanks mate I really appreciate this video

  • @Alister-vi8bs
    @Alister-vi8bs 11 місяців тому +1

    TYSM!

  • @volodymyrkosynskyi7431
    @volodymyrkosynskyi7431 Рік тому +1

    thank you!

  • @hajimeippo804
    @hajimeippo804 2 роки тому +1

    thabk you sir!

  • @World_information5568
    @World_information5568 Рік тому +1

    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.

    • @arslan99
      @arslan99  Рік тому

      I'm sorry I don't quite understand your question can you please elaborate

  • @fi1ipovv28
    @fi1ipovv28 Рік тому +1

    thats nice job . Thank you

  • @adrianedu5472
    @adrianedu5472 Рік тому +1

    Hello! Great job! Thanks for sharing! Really useful!

  • @arundhati7163
    @arundhati7163 2 роки тому +1

    Thanks, it's really very helpful.👍

    • @arslan99
      @arslan99  2 роки тому

      Glad you liked it 😃

  • @SaiPavanKumar19
    @SaiPavanKumar19 2 роки тому +2

    window.scrollTo() is not working

    • @arslan99
      @arslan99  2 роки тому

      There could've been a typo you might've Typed scrollto

  • @johanesalberto6136
    @johanesalberto6136 Рік тому +1

    wow bro, thank you so much

  • @AndresRojas-tr9ir
    @AndresRojas-tr9ir 2 роки тому +1

    Good tutorial, thank you so much!

    • @arslan99
      @arslan99  2 роки тому

      Of course, you're welcome I'm glad you enjoyed it

  • @renu_singroha_
    @renu_singroha_ 2 роки тому +1

    😊thank you sir ,very nice

  • @marcosvinicius-xt6hp
    @marcosvinicius-xt6hp Рік тому +1

    dude thanks you saved me 😂😂😂

  • @dungphanquang3512
    @dungphanquang3512 Рік тому +1

    Thanks so much

  • @stacksolutions7056
    @stacksolutions7056 2 роки тому +1

    Nice tutorial,,this worked for me 👍👍

  • @buildervision7082
    @buildervision7082 2 роки тому +1

    Perfect

  • @vivelamusica5610
    @vivelamusica5610 2 роки тому +1

    thanks!!!

  • @faisalahmad100
    @faisalahmad100 2 роки тому +1

    Thanks for help..sir

  • @saeedalberzawi9333
    @saeedalberzawi9333 2 роки тому +1

    Thanks 👍

  • @gregpuac
    @gregpuac 2 роки тому +1

    Gracias, muy útil (Thank you, very useful)

    • @arslan99
      @arslan99  2 роки тому

      No worries glad I could help

  • @ajk6690
    @ajk6690 2 роки тому +1

    nice tuto my friend

    • @arslan99
      @arslan99  2 роки тому +1

      Thank you I'm glad you enjoyed it

  • @godswillonyeka5973
    @godswillonyeka5973 2 роки тому +1

    Thanks man

    • @arslan99
      @arslan99  2 роки тому

      Np glad I could help. Also your name is awesome man 👀

  • @rafeifabulihya2814
    @rafeifabulihya2814 Рік тому +1

    شكرا

  • @mnnw148
    @mnnw148 Рік тому

    Great ❤

  • @Human_Evolution-
    @Human_Evolution- 2 роки тому +1

    I love you.

    • @arslan99
      @arslan99  2 роки тому

      Lmao glad I could help 😃

  • @artsycoder533
    @artsycoder533 2 роки тому +1

    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);
    });
    }
    }, []);

    • @arslan99
      @arslan99  2 роки тому +1

      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

    • @artsycoder533
      @artsycoder533 2 роки тому +1

      @@arslan99 I'll checkout out that stack overflow article, thank you!

  • @csbhagwant
    @csbhagwant Рік тому +1

    it worked 🫡