Just starting out with react and could use a little guidance.
I came across this interesting hamburger menu icon on codepen:
https://codepen.io/rss/pen/OJxZrR
The challenge I'm facing is getting the animation to function properly.
import "../../index.css";
const [style, setStyle] = useState("nav-container");
const changeStyle = () => {
setStyle("pushed")};
I attempted something similar to this and included a button onClick event to toggle state, but it's not working as expected.
<button
onClick={() => {
changeStyle();
}}
>
<div id="nav-container">
<div className="toggle-icon">
<span className="bar"></span>
<span className="bar"></span>
<span className="bar"></span>
</div>
</div>
</button>