2 ms·
What separation of concerns? // RenderComponent.js export default props => ( <div class="foo"> <button ...>...</button> </div>
by tracker1 8y ago
What separation of concerns?
// RenderComponent.js
export default props => (
<div class="foo">
<button ...>...</button>
</div>
)
// RenderComponent.scss
.foo {
button {
...
}
}
It looks to me like your stylesheet pretty much has the exact same structure as the component/template does. When you change one, by necessity, you change the other. Don't seem to be separate concerns to me. Only separate technologies.
Now, lets say you want your component's styling to adjust based on properties passed into the component... It's going to be easier, more consistent and less of a problem to make these kinds of variants with CSS in JS techniques. You can still inherent styling values directly or through theme injection.