DEV Community

Discussion on: Hide menu when scrolling in React.js

Collapse
 
gnuns profile image
Gabriel Nunes

Storing the top as a state key is probably better, but to use React.createRef() is also an alternative to getElementById.

Collapse
 
guimg profile image
Guim

Thank you both! I've made some changes on the nav id and how I manage the CSS too.