Re:React v17.0 Release Candidate: No New Features
by Gaelan on Monday August 10, 2020 @10:22PM
(#24116582)
That conflicts with HTML syntax, no? <input disabled /> is equivalent to <input disabled={true} />.
[ Parent
| on HN ]
Re:React v17.0 Release Candidate: No New Features
by acemarke on Monday August 10, 2020 @10:36PM
(#24116651)
Which 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.
Re:React v17.0 Release Candidate: No New Features
by floydnoel on Tuesday August 11, 2020 @09:05AM
(#24119860)
I, 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!