Hi,
I would like to suggest this new feature that may be useful: a custom global attribute as a DRY and KISS feature for sharing some repetitive coding or verbose styling. It is a bit familiar to Angular directive concept, but it is more functional and react-like.
const glyphIcon = (elm, val) => elm.className = "glyphicon glyphicon-" + val + " icon";
<div @glyphIcon="ok" >...</div>
@directive("glyph-icon")
const glyphIcon = (elm, val) => elm.className = "glyphicon glyphicon-" + val + " icon";
<div glyph-icon="ok" >...</div>
That is something you can already do:
const glyphIcon = (val) => ({ className: "glyphicon glyphicon-" + val + " icon" });
<div {...glyphIcon("ok")} >...</div>
Most helpful comment
That is something you can already do: