You would use a state to store the status of the menu.
const [hamburgerState, setHamburgerState] = useState(true);
And then:
<button type="button"
onClick={() => hamburgerState?setHamburgerState(false):setHamburgerState(true);}
className="c-hamburger c-hamburger--htx">
<span/>
</button>
Then you would use this state variable's value to change the visibility of the menu, usually by changing a className.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…