A
A
Alexander2021-07-17 22:48:52
css
Alexander, 2021-07-17 22:48:52

What is better to use to hide the menu when responsive?

Hello, tell me which is better to use and what are the pros and cons of these solutions.
There is a navigation menu that should be hidden on mobile devices. Which is better to use in this case,
display: none; using media queries or the react-responsive library that completely removes the element from the DOM? I will be grateful for the answer

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
ArtJH, 2021-07-17
@axrising

Well, you are wise)
To hide / open, use the same css display none + click event (js)
It is not necessary to connect react for such a very simple task.
+ you don't have to remove it from the DOM tree, then add it again to open the menu. This will once again load the site

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question