Smooth Page Scroll

  1. activeClass=“active” which automatically adds a class name “active” or you can use any other name, it is completely up to you. With a new class name added to the nav, you can style the link and make it stand out which indicates which page is browsing by the user.
  2. to ={page}, or you can type to= “home”. Because I pass the name to the function scrollLink. to keep my code DRY.
  3. spy = {true} This enable the ability to make Link selected when the scroll is at its targets position.
  4. smooth={true} this is will turn the smooth scroll on. And this is exactly what we need to make our website scroll smoothly.
  5. duration ={500} this is where you can control the speed of the smooth scroll.



Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store

Software engineer experienced in Ruby on Rails, React, and Javascript based programming.