Answer the question
In order to leave comments, you need to log in
How should the menu work?
This is my first time making menus myself and there are some points I would like to clarify.
The menu layout is something like this:
<ul class="header">
<li class="menuicon">
<!-- Hamburger -->
</li>
<li class="logo">
<!-- А здесь будет логотип -->
</li>
</ul>
<ul class="list">
<li>Item</li>
<li>Item</li>
<li>Item</li>
</ul>
.header
. On a mobile screen, I hide .list
. On click on the hamburger, I expand the .list under the header. input type="checkbox" hidden
to define in CSS, not open us menu, or is it not closed...? By input checkbox you can already add and remove styles. #menustate:checked {}
Link onClick={}
, I think it is very wrong. If the site will be opened on a desktop, but these functions are simply not needed... Answer the question
In order to leave comments, you need to log in
In React, it’s correct to put the current open/closed state into the state and, depending on this, render or not the corresponding markup, or add/remove a class that will already regulate the visibility and styles of elements.
You can also leave input if it suits.
There is no problem to write in each Link onClick. especially such that it was "very" wrong
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question