W
W
wakenbyWork2022-02-26 07:58:05
Sass
wakenbyWork, 2022-02-26 07:58:05

How to write react bem style in scss and is it necessary?

Link to the doc

I'm not sure if I should use scss in react or not. The react doc says that scss is not as useful in react as in normal layout. How do you think?

And how to write this in scss if there is still a profit from scss in react?

So:

.TodoItem {
  &-Left {
    &_size_big {
    }
    
    &_size_small {
    }
  }
}


Or nesting is better not to use?

And write like this:

.TodoItem-Left {
}

.TodoItem-Left_size_big {
}

.TodoItem-Left_size_small {
}


Or is this bem style not relevant to react.js?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
I
iBird Rose, 2022-02-26
@wakenbyWork

write as you please. if you don't work in any mail.ru thread or yandex, where many people can work on one project - everyone doesn't care how you write styles.
and if you still get a job in such a place, there will be clearly defined naming rules, style guides, etc.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question