Тёмный

How To Smooth Scroll in React - Smooth Scrolling Tutorial 

Code Commerce
Подписаться 42 тыс.
Просмотров 156 тыс.
50% 1

Опубликовано:

 

15 окт 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 128   
@deborahsanchez9607
@deborahsanchez9607 2 года назад
I''ve been dealing with this for 3 days and you made it so easy! thank u so much!
@codecommerce
@codecommerce 2 года назад
You bet! I’m glad you got it sorted out Deborah!
@TheMatriiKz
@TheMatriiKz Год назад
Thanks so much! redoing my previous portfolio that was Angular into React and ran into this issue.
@codecommerce
@codecommerce Год назад
Can be pretty easy fix :)
@muhammadjonnazarov146
@muhammadjonnazarov146 2 года назад
Thanks alot bro, Great video. Very short, simple and clear way of explaining.
@gamingcave4386
@gamingcave4386 5 месяцев назад
Thank you for the video. I have been trying to get this work since last three days.
@augustineedeh3565
@augustineedeh3565 5 месяцев назад
Found this super-duper helpful. Thanks man!
@Amaterasu469
@Amaterasu469 Год назад
Thx man, i watch your vids from a while and i just want to say they helped so thanks
@codecommerce
@codecommerce Год назад
Thank you sir!
@graysonharvey6933
@graysonharvey6933 Год назад
HUGE thank you! Redoing my portfolio and was stuck on this issue. You demo'd clearly and concisely. Cheers!
@guscarrillo5497
@guscarrillo5497 Год назад
On that boat as well!
@tikit601
@tikit601 11 месяцев назад
me too
@DIEGORAMIREZ-b4e
@DIEGORAMIREZ-b4e 4 месяца назад
Thank you, you helped me a lot... Greetings from Mexico.. :)
@nguyenthanhphongk17hcm81
@nguyenthanhphongk17hcm81 Год назад
Thank you, you are my life saver, Ive been struggling with this for 2 days 🤩
@abdulsamman2229
@abdulsamman2229 Год назад
mascha Allah, always explained very clear tip top
@codecommerce
@codecommerce Год назад
Many many thanks
@julielai2305
@julielai2305 2 года назад
I've been struggling finding how to scroll to another # without changing the URL. Thank you so much for sharing this!
@codecommerce
@codecommerce 2 года назад
You're welcome!
@tanmaysankpal2335
@tanmaysankpal2335 Год назад
Thank You soo much brooo.....I spent hours on trying various way
@codecommerce
@codecommerce Год назад
Happy to help
@anarosol6133
@anarosol6133 5 месяцев назад
Just what I needed. Thanks!!!!!!
@amannambisan6870
@amannambisan6870 Год назад
Thank you for this! saved my life!!
@redYELL0Wblue
@redYELL0Wblue 2 года назад
Thank you for the video! Very much appreciated!
@codecommerce
@codecommerce 2 года назад
You’re awesome!
@Coderruhit
@Coderruhit 3 месяца назад
just wow awesome explain thanks 😍
@pedrobrandao23
@pedrobrandao23 2 года назад
Thank you for the video, helped me a lot! Got one more subscriber
@omkarpawar7009
@omkarpawar7009 2 года назад
U made it simple man ur subscribers are well deserved
@pete531
@pete531 11 месяцев назад
Hi, this works only second time click after fresh page reload. on the initial click the offset will be messed up but on second click perfect
@nhuytruong2796
@nhuytruong2796 Год назад
Thank you very much for this great content. It work!
@thesunofodin
@thesunofodin 2 года назад
Thank you, this helped tremendously!
@MegaMetallica4ever
@MegaMetallica4ever 9 месяцев назад
Thank you so much for this video, but can you tell me how to make a path display in the url. I have no problem achieving all of this when I have a multipage app.
@anantheswar9048
@anantheswar9048 3 месяца назад
clean and clear!
@amatakchannel3735
@amatakchannel3735 2 года назад
Short and easy to follow thanks
@codecommerce
@codecommerce 2 года назад
Thanks!
@jpcc1223
@jpcc1223 2 года назад
thats exactly what i was looking for! thanks man
@codecommerce
@codecommerce 2 года назад
Thank you Joao
@Sahrawiyun
@Sahrawiyun 2 года назад
Another way of achieving this in modern browsers is to set the css scroll-behavior of the html/body to smooth.
@codecommerce
@codecommerce 2 года назад
Thank you for the feedback - I will definitely try this. :)
@julianafb1245
@julianafb1245 2 года назад
BOOM! Worked, without changing anything in my code. Thank you!
@s1art7
@s1art7 Год назад
@@kalahari8295 u need set important!, because the browser have a default scroll-behavior
@paschalokafor9043
@paschalokafor9043 Год назад
It works but it will keep reloading your page which u dont need in your react app since it is a Single Page App
@DuminoreDev
@DuminoreDev 4 месяца назад
Awesome, thank you!
@em01234567
@em01234567 2 года назад
Honestly the best video on this topic!
@nihadyaqublu2359
@nihadyaqublu2359 Год назад
Thank you very much for this great content. Really helped !
@joshuaberrios
@joshuaberrios 2 года назад
Thanks so much brother. Awesome tutorial!
@codecommerce
@codecommerce 2 года назад
My pleasure dude!
@jonasbjrnpedersen2130
@jonasbjrnpedersen2130 2 года назад
Thank you so much for this! A great help!
@codecommerce
@codecommerce 2 года назад
Thank you my friend!
@jeckjonny6448
@jeckjonny6448 2 месяца назад
Hello, thank you very much for the video. There is a question, how can I make this approach so that when the page is reloaded, the scroll will automatically go to the top and not be saved in the active section of the page?
@kedarmakode5664
@kedarmakode5664 Год назад
Hi, I created react app using vite and i am using tailwindcss for styling. I followed your tutorial still its not working. I even tried with tailwind class for smooth scrolling. Can anyone please help
@quanghuynguyen3356
@quanghuynguyen3356 Год назад
very helpful, thank you so much
@afe5953
@afe5953 2 года назад
Thank you. very short and concise explanations I like it.
@nicolassuarez2933
@nicolassuarez2933 Год назад
Outstanding! How to scroll on page load without a click? useEffect maybe? thanks!
@escuderomdz
@escuderomdz Год назад
I used ' const handleWindowsLoad = () => { scroll.scrollToTop(); setActiveSection('home'); }; window.addEventListener('load', handleWindowsLoad);' Maybe this work for you too
@dewasembiring7286
@dewasembiring7286 2 года назад
Thanks bro, you made it easy!
@codecommerce
@codecommerce 2 года назад
Glad it helped!
@farhana5499
@farhana5499 8 месяцев назад
I don't know why my scroll element is weird. it keeps scrolling to the bottom of the clicked element, instead of showing it from the top ;(. Please help...
@Rob-J-BJJ
@Rob-J-BJJ 11 месяцев назад
whenever I hover over the button the mouse icon turns into the typing icon how do I fix this
@azeezabass288
@azeezabass288 8 дней назад
You really saved my ass today
@frontendwithsalimi
@frontendwithsalimi Год назад
Is this work also when i click on the link When i click on the link i go down to the section and the active change depending on it?
@ouailtayarth4012
@ouailtayarth4012 2 года назад
When you click on each nav bar to navigate to a specific section, the link renders localhost:3000/#about. It didn't change the name of that section localhost:3000/#demo. What changes should be made to fix that? Thanks for your efforts Man!!
@khalediman9740
@khalediman9740 5 месяцев назад
Thank you for the helpful video you've made. However, I have an issue with hiding the Id from the URL, I mean when I navigate to a specific section inside the same page I don't want the section Id to appear after the localhost:3000, like for example localhost:3000/#About. I've tried to use the hashSpy from react-scroll library, however it didn't' work, so can someone help me with that?
@decide5357
@decide5357 2 года назад
Wow... Really awesome
@ASHOKKUMAR-vx1uh
@ASHOKKUMAR-vx1uh 2 года назад
Thanks man realy helpful
@truewisdom1123
@truewisdom1123 6 месяцев назад
Thanks alot ❤
@m__link6499
@m__link6499 Год назад
I Ve tried to use it with Next js but it seems like there is a conflict with the Link component from Next js…How can I implement it in Next Js please?
@NeerajKumar-wk4qq
@NeerajKumar-wk4qq Год назад
Thank you so much sir
@Adam-vm6tc
@Adam-vm6tc 2 года назад
Thank you I've been working on this for 3 days and also trying to get ugly hash out of the url with the link. I had no idea this package existed.
@fhkodama
@fhkodama 2 года назад
Great video! :)
@codecommerce
@codecommerce 2 года назад
Thanks man!
@devfren
@devfren 2 года назад
so good thankyou!
@codecommerce
@codecommerce 2 года назад
Thank you!
@developedbyvarun
@developedbyvarun 2 года назад
Amazing!
@mustangboy3533
@mustangboy3533 7 месяцев назад
Thanks 😊❤
@ygaaaoo
@ygaaaoo Год назад
thanks my brother
@anantjain9679
@anantjain9679 3 месяца назад
can we change the route on scrolling like active nav items
@flavio5693
@flavio5693 Год назад
can you make a project with React and GraphQL? maybe a CRUD project with backend end React Typescript?
@codecommerce
@codecommerce Год назад
That would be cool
@rafihasan4061
@rafihasan4061 2 года назад
Thanks for the video...Thanks a lot
@codecommerce
@codecommerce 2 года назад
Thanks dude!
@fatimaiqra2169
@fatimaiqra2169 3 месяца назад
thanks a lot!
@ubraun07
@ubraun07 Год назад
amazing content!
@codecommerce
@codecommerce Год назад
Thank you my friend!
@festuskoech6612
@festuskoech6612 2 года назад
I came, found the source code, I hit the like button, subscribe button... and byeeeeeee! Thanks!
@codecommerce
@codecommerce 2 года назад
Glad to help dude!!
@cjt9150
@cjt9150 2 года назад
Thanks, subscribed & liked, the one thing i want to know, how to use this react-scroll with react-router-dom v6, both have Link tag??, kindly give a solution
@codecommerce
@codecommerce 2 года назад
I would advise using only one feature on a specific page. This would clear up that issue.
@souloomonkey1360
@souloomonkey1360 2 года назад
You can import Link as LinkRouter for example it will just re-name it .
@CanaldoSiloks
@CanaldoSiloks 11 месяцев назад
Thank u man
@fakhruddinshovon8385
@fakhruddinshovon8385 10 месяцев назад
really that's nice
@s1art7
@s1art7 Год назад
hi, why not use the property css. scroll-behavior: smooth;? good practices? but this package doesn't change the url, thats perfect for single page app, like a portfolio maybe... thx
@codecommerce
@codecommerce Год назад
You’re right :)
@Nilesh-y3b
@Nilesh-y3b Год назад
Thanks i understand
@escuderomdz
@escuderomdz Год назад
Hello! Thanks for this, it's great! But I have a problem because, for example, if I am in the 'demo' section and I click on the 'home' section, the css style for the 'active' class is applied on top of 'demo', then 'testimonials', then ' about' and then 'home', but the idea is that the 'active' class applies only to the section I click on. Do you know what I'm doing wrong or what is the solution?
@vijayvj5490
@vijayvj5490 Год назад
really good one help full for me 🌹🌹🌹🌹🌹
@codecommerce
@codecommerce Год назад
Thank you!
@nedagholami374
@nedagholami374 2 года назад
thanks. very good
@PeriklesPeriklesoglu
@PeriklesPeriklesoglu Год назад
thank you
@devrook
@devrook 2 года назад
What if you want to use { Link } from react-router-dom as well? It gives errors with the two imports being the same
@bowmasterish
@bowmasterish Год назад
I imagine you'll probably have to import one using the 'as' keyword to change the name of your import
@christeneyeshua4559
@christeneyeshua4559 2 года назад
this helped a lot Tq
@yuutotokuda4309
@yuutotokuda4309 2 года назад
Thank you for the great video. I have one question. I am creating header that jumps to desired contents with the link in header, but I have no idea how to make the header component responsive. I am using react-bootstrap and I have already made header with it. I would like to know how to make the header made in bootstrap with react-scroll.
@cristiandanielherrera4349
@cristiandanielherrera4349 2 года назад
Very good
@romariojs94
@romariojs94 2 года назад
Thanks alot!
@codecommerce
@codecommerce 2 года назад
You're welcome!
@shubha.tshubha.t8997
@shubha.tshubha.t8997 Год назад
THUMBS UP
@RideorDyna
@RideorDyna Год назад
What would I do if I have a contact page that is separate from the home page? I want to navigate to certain sections on the home page from the contact page.
@gauravjaiswal7296
@gauravjaiswal7296 8 месяцев назад
use react router dom library for ur code
@tomasburian6550
@tomasburian6550 2 года назад
Thor himself has descended from Asgard to teach us code! Works great, thanks a lot. So if I got this right, it can't handle switching to another page & then scroll?
@codecommerce
@codecommerce 2 года назад
HAHA so awesome- thanks dude! That's a great question - I bet we can swing that! I'll play around with it.
@kunwarpreetsingh8314
@kunwarpreetsingh8314 5 месяцев назад
why it's not working on my website
@dominnumb6367
@dominnumb6367 2 года назад
Hey man! Really nice video, I just have one question. I need to do automatic scrolling if I get new message. I handle to get new div with special ID, that's all good. But how I can make for example function, and everytime I will run it, It will do automatic that ? I hope you understand what I mean and Thank you!
@codecommerce
@codecommerce 2 года назад
I'm sorry, I don't think I am 100% following. Are you referring to an onClick event that could trigger a function to scroll to a specific part of the page?
@ArthurBielenberg
@ArthurBielenberg Год назад
Спасибо большое, Клинт 🙏
@pratik1439
@pratik1439 Год назад
thanks sir😊😊😊😊😊😊😊😊😊😊
@venkateshjajula5711
@venkateshjajula5711 Год назад
I got my solution here ! Tq
@codecommerce
@codecommerce Год назад
Awesome dude!
@ДмитроКвітчатий
thx
@zappist751
@zappist751 Год назад
THANK YOU LORD THANK YOU JESUS AND THANK YOU SIRRRR
@codecommerce
@codecommerce Год назад
Thank you! Also you can use “scroll-behavior” in CSS :)
@zeddscarlxrd4331
@zeddscarlxrd4331 2 года назад
ur such amazing
@vigneshkundar467
@vigneshkundar467 2 года назад
```Just use this one line of css``` inside public/index.html html { scroll-behavior: smooth; }
@pedrovictorsaraiva8705
@pedrovictorsaraiva8705 2 года назад
Doesn't work in React
@CrazyGunner782
@CrazyGunner782 Год назад
3:40
@Salmankhan_38827
@Salmankhan_38827 2 месяца назад
Hah just apply scroll-behaviour : smooth; in css and you are done.
@mohamed404eg
@mohamed404eg Год назад
// go to section if (window.location.pathname === "/Projects") { console.log( document.querySelector("#Projects").getBoundingClientRect().top ); } window.scrollTo({ top: document.querySelector("#Projects").getBoundingClientRect().top, left: 0, behavior: "smooth", }); }
@smartfastplan2188
@smartfastplan2188 2 года назад
Thank you so much sir
@fhrmk
@fhrmk Год назад
thank you
Далее
I became a way better developer when I did this..
4:35
САМАЯ ТУПАЯ СМЕРТЬ / ЧЕРНЕЦ
1:04:43
ROBLOX TRAND AGAIN. Part 7☠️🗿🙋🏻‍♀️
00:16
Smooth Scroll to an Element in React
8:38
Просмотров 34 тыс.
Subtle, yet Beautiful Scroll Animations
5:04
Просмотров 1,7 млн
The Parallax Effect // 5 Minute WebDev Project
5:01
Просмотров 629 тыс.
How To Smooth Scroll In React
13:49
Просмотров 28 тыс.
How To Make a Parallax Scrolling Website In React
13:28
How to use Framer Motion in React JS Website
5:55
Просмотров 16 тыс.