上QQ阅读APP看书,第一时间看更新
JavaScript templating
Finally, we started with the assumption that one of the advantages of moving the templates inside our components instead of using an external template library is that we can use the full power of JavaScript, so let's start looking at what that means.
The spread attributes is an example of this, and another common example is that JavaScript expressions can be used as attribute values by enclosing them within curly braces, as follows:
<button disabled={errors.length} />