DEV Community

Discussion on: Navbar hide and show on Scroll using Custom React Hooks

Collapse
 
link2twenty profile image
Andrew Bone

I've fixed the names, I changed the name part way through making the demo so I guess it got confused and kept made a new version rather than renaming.

Controlling the classes like this means you know for sure what classes you element has if you start adding and removing them with JS you have to keep track of all the classes and make sure you don't remove any by accident, or even leave any on the element when you don't mean to.