Skip to content
Advertisement

How to display specific elements on a page at a specific screen resolution

How to display specific elements on a page at a specific screen resolution. A kind of mobile version for the site, something like media queries, only which will display a certain block of js (react) / html (jsx) code at a certain resolution

Advertisement

Answer

You can take a look at the answer on this similar question

If you’re using JSX the usage should be wrapped into {} for example:

JavaScript

The better way to do this might be to still render it and then use CSS classes and media queries to not display it:

JavaScript
User contributions licensed under: CC BY-SA
8 People found this is helpful
Advertisement