Add support to JSX transform for <hyphenated-tags>#1539
Add support to JSX transform for <hyphenated-tags>#1539zpao wants to merge 1 commit intofacebook:masterfrom
Conversation
|
I think there's a bigger issue to consider here and it's HTML5 custom elements (which are identified by having at least one hyphen, so hooray HTML for Seeing as HTML elements must be lowercase in React and UpperCamelCase is preferred (?) for custom components. It kind of makes sense to apply the same special treatment to all HTML elements, i.e, A simple solution would be to only differentiate between HTML and custom components by the first char being upper-/lowercase. We would no longer need a whitelist of tags in JSX. Everything that is lowercase reads from whatever the JSX docblock says, everything that is uppercase assumes its local. I wouldn't really mind, but I imagine many wouldn't see it as favorably... but it seems to me that if we don't do it (kind of) like that it, that camelCasing would be preferred/necessary, but then how do we keep this mess of HTML, SVG, HTML custom elements and React components separated? Also, not really related to this, but to make everything a little bit more exciting, SVG has its own |
|
Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Facebook open source project. Thanks! |
This really only adds support for tags in our knownTags list. If we want to support SVG fully we'll need to do that OR we do like we do for styles and force camelCase.
This really only adds support for tags in our knownTags list. If we want
to support SVG fully we'll need to do that OR we do like we do for
styles and force camelCase.
Tested with
<font-face/>which producesReact.DOM["font-face"]. See #938 for even more.