Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

What’s to stop you using single file components in React?

Having everything in one file was the thing I didn’t like about Vue - constantly scrolling up and down the file between the methods and the template/styling got pretty annoying quickly.



> What’s to stop you using single file components in React?

Probably the same thing that stopped you from not using SFCs in Vue: One is idiomatic, the other isn’t ;)


What’s to stop you using single file components in React?

The only way I know of to make them is to use styled components. RedwoodJS seems to doing something like a template literal for styling but that's still not really the same. In my opinion Vue's <style scoped> approach is much more elegant.

constantly scrolling up and down the file between the methods and the template/styling got pretty annoying quickly

Buy a bigger monitor. :)




Consider applying for YC's Fall 2026 batch! Applications are open till July 27.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: