attribute empty-string is translated into 'true'
imbroglioj opened this issue · 1 comments
imbroglioj commented
When an attribute like href or placeholder is assigned the empty string; react-templates replaces the empty string with true
Example: placeholder="" --> {... placeholder: true ...}
A workaround is to enclose the empty-string in curly braces: {""}
.
(Coming from Angular, I've become a big fan of react-templates in the last couple days. The amount of empty boilerplate and crufty JSX+JS it replaces is impressive. And the ability to step through the resulting rt.js for debugging is a lifesaver.)
nippur72 commented
they are translated into true
in order to support boolean attributes, e.g.:
<input disabled /> <!-- becomes: disabled=true -->
This because in HTML <input disabled />
and <input disabled="" />
are the same thing.