HTML has a finite set of boolean attributes whose presence is interpreted as true, regardless of the actual attribute value and when it's not present it's interpreted as false. Knowing that, we can bypass calling into jsxattr to serialize and encode the value ourselves. If the value is a boolean literal we can serialize or skip the attribute ourselves too.
It probably doesn't matter much for perf in the grand scheme of things, but I guess why not go all in.
HTML has a finite set of boolean attributes whose presence is interpreted as
true
, regardless of the actual attribute value and when it's not present it's interpreted asfalse
. Knowing that, we can bypass calling intojsxattr
to serialize and encode the value ourselves. If the value is a boolean literal we can serialize or skip the attribute ourselves too.It probably doesn't matter much for perf in the grand scheme of things, but I guess why not go all in.