- Ham: Ham usually appears in the mobile view. The function 'handleClick' is used to trigger the Ham. The useEffect used in line 11 is used to hide the Ham whenever the page is scrolled.
The props and states of Header is listed below:
- sticky - Used to make the Navbar, sticky (The name of the prop is 'sticky')
-
[ham, setHam]:
This state is used to active and hide the Navbar especially in mobile view. The ham state is set at the function handleClick to turn the Navbar visible and invisible.