

That would be quite wasteful, but it would work.Īnother option would be to use a single set of components, but focus on using CSS grids and other modern techniques to move things around in the different media queries. The best I can come up with is to render every single version of the page, and then use an actual css media query to hide all but the version you want. I honestly don't think there is a solution. However, doing this via SSR is an interesting problem.
Flickery media queries how to#
My answer is how to make responsive designs in react without having to worry about the CSS layout or media queries by just switching components. Not to mention the additional complexity! If you are in the position, reject these designs.Īh I see what you mean, I misunderstood your question. I would also check with the design team, why they did it the way they did, because its clearly not ideal. So only solution is to send down all markup like u/andrewingram suggested and work with media-queries. If you just return say the mobile version from the backend, the other versions will have a hydration missmatch and screen-flickering. So the server does not know what markup to send down. Additionally you won't know the exact width of the browser window or the orientation of the device, etc. They provide a user-agent but you cannot rely on that. A Request from a Browser or from a Google-bot or other crawler does not give (much) information about what device they are. SSR does not work with conditional renderig based on media queries. To add what has already been said (that the problem already starts in the design and you will unable to solve it properly):
Flickery media queries mods#
Mods will remove such posts posted on other days. If you want to show off or need feedback on your portfolios, you should post on Sundays, and Sundays only. Therefore posts of NSFW React apps must link to source, not to the live NSFW app. We ask that NSFW posts nevertheless focus on the technology rather than the content. links to NSFW apps built with React) but try not to be prudes.
Flickery media queries code#
Please link some source code (or if not possible, we understand, link some live demo or codepen so that people can try you out and learn from you) 6. We're all here to learn from you, but can't learn very much from a video recording. Demos should link source code or live demos If you need further guidelines on spam, see Reddit's guidelines on Spam.

Per Reddit guidelines for self-promotion, you are definitely welcome to promote your own content as part of your participation in this community, but if you repeatedly post low quality crap you will be banned. Telling people to "get out" of the industry or that they are not good enough in some shape or form is a bannable offense. Reasoned criticism of React or any other library is welcome, but spare us your rants. Polite or Constructive criticism is welcome but don't rag on other people's work or attempts to improve themselves. Interested in building mobile apps using React Native? Check out /r/reactnative! Rules 1. A community for learning and developing web applications using React by Facebook.
