3 ms·
That conflicts with HTML syntax, no? <input disabled /> is equivalent to <input disabled={true} />.
by Gaelan 6y ago
That conflicts with HTML syntax, no? <input disabled /> is equivalent to <input disabled={true} />.
- acemarke 6y agoWhich is why the current JSX syntax uses that as a synonym for `disabled={true}`. Agreed that it matches HTML better, but having written an awful lot of `someLongVariableName={someLongVariableName}`, I sure wish I could stop repeating myself there.
- floydnoel 6y agoI, too, find it ridiculous to repeat `foo={foo}` over and over again. So I use the spread operator with ES6 shorthand object syntax. Now it’s `{...{ foo }}`. No breaking changes needed!
- efrafa 6y agoThat would just be confusing. What would happen with <input disabled /> then? What if there is a global disabled var?
- tW4r 6y agoI agree, I think <Element {prop} /> works better