Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

custom elements, as implied in lower-case-convention.md, not working #2430

Closed
pekim opened this issue Oct 29, 2014 · 6 comments
Closed

custom elements, as implied in lower-case-convention.md, not working #2430

pekim opened this issue Oct 29, 2014 · 6 comments

Comments

@pekim
Copy link
Contributor

pekim commented Oct 29, 2014

As I understand lower-case-convention.md, custom element names are now supported.

However when I try to do this (using 0.12.0), following the example in the gist, the jsx fails to be transformed.

var component = React.createClass();
return <component />;
Error: Lower case component names (component) are no longer supported in JSX: See http://fb.me/react-jsx-lower-case
    at Array.visitReactTag [as 0] (/home/mike/hipcac2/node_modules/react-tools/vendor/fbtransform/transforms/react.js:66:13)

What am I misunderstanding, or doing wrong. Or is that gist misleading?

@zpao
Copy link
Member

zpao commented Oct 29, 2014

component was an example there. It was being used to indicate that if there were an HTML tag called component then React would use that, not your custom component.

Currently in the JSX transform we still check a whitelist of known HTML elements. We won't be doing that in the future, so 0.12 is a release that allows you to upgrade without breaking in completely mysterious ways. Eg, here we break at compile time so you don't ship code like this to production.

@zpao zpao closed this as completed Oct 29, 2014
@pekim
Copy link
Contributor Author

pekim commented Oct 29, 2014

So the intention is that in a future version the whitelist will not be checked, and we'll be able to render custom elements at will? At least that's what I'm hoping.

In my case I want to be able to render a webview tag, which is likely a little too obscure to warrant being whitelisted.

@zpao
Copy link
Member

zpao commented Oct 29, 2014

Correct. And yea, I wouldn't add webview to the whitelist anyway. Not because it's obscure but because it's a non-standard tag.

@waldreiter
Copy link
Contributor

Support for <webview> was requested here: #2108

@zpao
Copy link
Member

zpao commented Oct 29, 2014

As I was closing that issue I noted that you could use React.createElement('webview') directly. However it's not available on React.DOM or as part of the JSX transform.

@pekim
Copy link
Contributor Author

pekim commented Oct 29, 2014

For now I'm using dangerouslySetInnerHTML as a workaround .

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants