bradfrost.com
Template Technology Agnosticism
7
I absolutely love Jonathan Snook's thoughts here. He discusses how the Mustache templating engine actually gets quite close to tech-agnostic HTML, and that's a good thing for systems that need to go to a bunch of places. This legibility becomes importan... Read full article
Ash
8y agoThe React version can be written as a stateless functional component, which is a bit more concise:
const Card = ({ img, title, desc }) => (
<div className="c-card">
<img src="{img}" className="c-card__img" />
<h2 className="c-card__title">{title}</h2>
<p className="c-card__desc">{desc}</p>
</div>
)
And quite a lot closer to the Mustache version:
<div class="c-card">
<img src="{{ img }}" class="c-card__img" />
<h2 class="c-card__title">{{ title }}</h2>
<p class="c-card__desc">{{ description }}</p>
</div>