3 ms·
> don't forget to use key as needed, and className Those are part of React, not JSX itself. Compare Vue's use of JSX, for example, which just uses `class` and
by crooked-v 4y ago
> don't forget to use key as needed, and className
Those are part of React, not JSX itself. Compare Vue's use of JSX, for example, which just uses `class` and `for` instead of `className` and `htmlFor`.
- scotty79 4y agoReact just went for JS naming of the attributes instead of html naming of the attributes. Reasonable, if annoying, choice.
- mattigames 4y agoFalse, for a lot of attributes you have to use the HTML naming of the attributes, so is not consistent, for example to use aria-label you have to write it exactly like that (not ariaLabel as when using JS)
- scotty79 4y agoaria-* and data-* apparently are the exception More on that: https://stackoverflow.com/questions/52398380/why-react-wai-aria-is-not-in-camelcase#52489695 https://stackoverflow.com/questions/52398380/why-react-wai-a...