2 ms·
Generally, I don't like the idea of componentizing a compositional concern. It's not that you have a space, you just want to express what the composition looks
by lhorie 6y ago
Generally, I don't like the idea of componentizing a compositional concern. It's not that you have a space, you just want to express what the composition looks like. But by doing it in this way, the description is happening inline within a larger context.
Here's an analogy to illustrate what I mean: Imagine you were writing a story, but every time you wanted to mention a character, you instead had to describe how they looked, inline in the middle of the sentence. This is kinda the same thing.
> Semantically, it feels weird to me sometimes
If we're talking about semantics in the way that people used to talk about semantic web, neither the space nor the image have semantic value. The vanilla version might be:
<button class="back button">Go back home</button>
Translating that to React might look like this:
<BackButton>Go back home</BackButton>
where `BackButton` is a specialization of `LinkButton` that uses CSS to add the icon (or not, if, for example, the mobile version doesn't have the real estate for it)