Basically showing how you could achieve the bellow Navbar in react .
firstly you need to create a file then name it Navbar,
add
import from '...
For further actions, you may consider blocking this person and/or reporting abuse
Thanks! I created a version for functional components:
const [show, setShow] = useState(false);
useEffect(() => {
window.addEventListener("scroll", handleScroll);
return () => window.removeEventListener("scroll", handleScroll);
}, []);
const handleScroll = () => {
setShow(window.pageYOffset > 140);
};
nice thanks for that I'll add and give credit , working on a library for it
Hey, a newbie here. Got a question with your React code.
Shouldn't you have a constructor inside a class component??
only if you're passing prop
ahhh i see!
Thanks for your response. ♥
wish you luck , react is actually easy and interesting, All the best
Good work, thank you
Wasn't able to run this. Probably due to out of date?
still used it today for a project
I made a library out of this, check it out
Great rhanks