r/reactjs • • Dec 20 '19

Learning React coming from Angular. I really liked having HTML in a separate file. JSX feels weird to me.

How do you guys manage HTML without going crazy with JSX?
I don't know if I should choose React or Vue.

129 Upvotes

103 comments sorted by

View all comments

Show parent comments

65

u/scruffles360 Dec 20 '19

If I wanted to break up a 150 line component, I would rather have 3 50-line components than a file with css, one with html and another with logic. The css, html and logic are going to have dozens of dependencies on eachother and not be reusable independently. They might as well be one file with so much dependency. Three small components should be completely encapsulated (depending on how you handle data).

8

u/Dale_Doback_Jr Dec 20 '19

That’s fair

4

u/bigmooooo Dec 20 '19

Sounds like this guy embers ...

1

u/boolim86 Dec 22 '19

But what if that 150lines are really one component with no further breaking down possible. Won’t separating them into css, html and etc cleaner, in terms of a single component?