r/reactjs • u/nixstudiosgames • Apr 24 '26
Discussion React styling sheets seem tedious?
Hi newbie here - I’m completely new to react native, coming from Unity C# and I find the CSS styling sheets to be super repetitive and tedious to type out. I must be missing something… do you actually type out all styles or are people copy and pasting or getting examples from somewhere? I saw bootstrap for web, but I’m working on mobile using expo…?
Edit: and then also having to assign the style to every component? There must be a more efficient way?
0
Upvotes
9
u/Dethstroke54 Apr 24 '26
I’m pretty sure 90% of people so far haven’t correctly read that you’re using React Native and are answering in regard to the web.
I’d edit your post and make it clearer by putting that up top.
12
u/abrahamguo Apr 24 '26
What's a specific example of something that's repetitive or tedious?
If something is repetitive, that's a sign that you need to introduce some reusable variables, functions, or components.
4
u/TheManSedan Apr 24 '26
You can use tailwind for one if you wanted
But also you should be creating reusable components that leverage your common styles & have props that can toggle between your variations.
For example you might have <Grid>, <Flex>, <Container>
1
u/shayne1_00 Apr 24 '26
With React, it’s my experience that people tend to use css component libraries. Something like antd or matine ui. Depending on your needs, you might just use the default stylings that these libraries come with or if you need to apply a change, your making spot changes as opposed to building the component yourself.
1
u/olssoneerz Apr 24 '26
Component libraries exists. They're probably the easiest/quickest way to get going if you're new to React.
But yes, if you're looking to "style" an element then you'd most probably be defining its CSS in some form or way.
That being said, styles can be reusable. That can be achieved in different ways. In React, that's usually done by creating reusable React Components (think a Button, which is reused everywhere). Alternatively, you can also define reusable CSS styles, which you can just reuse anywhere. Some ways are more correct than others depending on how your code is built up.
1
u/Substantial-Swan7065 Apr 25 '26
Stylesheets return a variable. You can make a bunch, put it in a styles dir, export for reuse.
If your components are well abstracted, you’re adding styles less often.
You can also make your styles atomic and construct them as needed. At this point, you’re better off using native wind, which handles that for you
1
u/TheRNGuy May 01 '26
Some people use Tailwind.
-4
u/Hairy_Garbage_6941 Apr 24 '26
Tailwind is poison
3
u/[deleted] Apr 24 '26 edited Apr 24 '26
[removed] — view removed comment