Re:Vue.js vs. React
by octalmage on Saturday August 19, 2017 @01:26PM
(#15054497)
I love single file components. I used Polymer before React and that is the thing I miss the most. I've also been using CSS-in-JS for the same reason. I landed on JSS for now, but I'm hoping we'll see a solid scoped CSS solution soon.
[ Parent
| on HN ]
I'm still to be totally convinced by single page components, the idea of mixing languages within a file just doesn't feel right.
I think I'd prefer to have a component directory with HTML, JS/TS and CSS/SCSS files in.
Doesn't that depend on pipeline? I've been doing for polymer components with html css and js split into separate files.
They get concatenated into single file in build process.
Not by default as far as I know. There's more info here, it's doable but not pretty.
The last example looks normal to me?
I've been very impressed with styled-components - it's outstanding. Inline, scoped, fully native CSS.
If you're using vscode add plugin "Template literal editor" and you get full intellisense on the CSS too!