Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
281 views
in Technique[技术] by (71.8m points)

reactjs - Make screensize rules with css or render components based on screen size?

I'm currently learning React so I dont know which is the best way to make webs responsive, I'm using Semantic UI React as CSS Library. I'm having some problems when displaying on mobile, but on desktop works perfectly.

The question is basically the title.

question from:https://stackoverflow.com/questions/65946662/make-screensize-rules-with-css-or-render-components-based-on-screen-size

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

I would advise you to use CSS media instead to simply modify what you need.

Creating extra components depending on the size seems to me to be too much of a solution, although it can be useful in some cases.

From my point of view I can only advise you to add simple rules in CSS.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...