4 ms·
I much prefer putting the styles in a separate {componentName}.scss file, import'ing that into the component and using the Webpack Extract Text Plugin: https:/
by mottomotto 9y ago
I much prefer putting the styles in a separate {componentName}.scss file, import'ing that into the component and using the Webpack Extract Text Plugin:
https://github.com/webpack-contrib/extract-text-webpack-plugin https://github.com/webpack-contrib/extract-text-webpack-plug...
I guess now you have two files per component but to me, it's well worth it.
- onenite 9y agoYou can work with two files per component if you must truly put the styling in another file. One of the boons of react is that you can create a set of reusable base components that can be built upon throughout your app. If you can code-split the app, lazy-loading components as needed, and if you can cache all of the static app anyway, why does it matter if the presentation is tied to the logic? The same can be said for vue.js. :) The two languages have many merits and they both make their own sacrifices. But they are ultimately two peas of a pod. Like Thor and Loki. But who is Thor and who is Loki? ;)