3 ms·
My only real gripe about JSX is the crazy attribute casing rules. If it looks like HTML then attributes should be case-insensitive just like HTML. The worst of
by inimino 10y ago
My only real gripe about JSX is the crazy attribute casing rules. If it looks like HTML then attributes should be case-insensitive just like HTML. The worst of it is (unless this has changed) they are just silently dropped without any error message.
- insin 10y agoThe React ESLint plugin's no-unknown-property rule is handy for catching (and automatically fixing) this: https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/no-unknown-property.md https://github.com/yannickcr/eslint-plugin-react/blob/master...
- inimino 10y agoGood to know, thanks. That's a good stop-gap, but the tool itself should either pass through everything to the HTML or throw errors on anything that isn't going to get passed through. The silent failure mode is a UX bug.
- ramchip 10y agoIf I understand your comment correctly, this is checked in more recent versions of React: https://facebook.github.io/react/warnings/unknown-prop.html https://facebook.github.io/react/warnings/unknown-prop.html
- inimino 10y agoIt does seem to be the same issue. That's great, it will certainly avoid some frustration.