3 ms·
for and class are not reserved in HTML, they are in JS, but why would that matter for JSX?
by dsego 9y ago
for and class are not reserved in HTML, they are in JS, but why would that matter for JSX?
- mlsarecmg 9y agoconst { for, class } = this.props Will crash. It's just a bit inconvenient (and inconsistent for beginners) having to write: const { for: forHtml, class: className } = this.props Some react-like libs do allow it, but the dom api takes offcial precedence, so it's all fine. It's just that HTML in general was made without taking all the things into account we demand of it today. It wasn't even made for imperative inflating, so the dom-api faced the same troubles.