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

Export createDOMComponentClass() #146

Closed
petehunt opened this issue Jul 1, 2013 · 10 comments
Closed

Export createDOMComponentClass() #146

petehunt opened this issue Jul 1, 2013 · 10 comments

Comments

@petehunt
Copy link
Contributor

petehunt commented Jul 1, 2013

On IRC today someone was missing a tag in ReactDOM. Should we export createDOMComponent() as an escape hatch?

@fabiomcosta
Copy link
Contributor

I agree this should be available and documented.

@vjeux
Copy link
Contributor

vjeux commented Dec 30, 2013

👍

@radebrecht
Copy link

+1 to that. At the moment adding the missing svg tags is a bit pokey.

@zpao
Copy link
Member

zpao commented Jan 10, 2014

FWIW, this won't help the JSX transformer which maintains it's own list of tags it recognizes and converts to React.DOM.*

@sverrejoh
Copy link
Contributor

@zpao I'm sure the custom DOM nodes can be imported into the local scope, so when JSX converts them (like it does with React components), it will just work.

In addition to SVG tags (which can all be supported by React eventually) there is also custom tags needed by legacy code, or proprietary systems. This is tags that will never be a part of React, and the only obvious alternative now (beside patching React) is to use dangerouslySetInnerHTML, which is a little tedious.

So I'd be all for having a clean way to expand the supported DOM nodes with something like createDOMComponent.

@zpao
Copy link
Member

zpao commented Feb 3, 2014

@sverrejoh As somebody who works on React, I'm saying that merely exposing this function doesn't add the tags to the JSX list. So if you want to be able to run jsx on your code and have new tags be converted to React.DOM.newtag then we need to do more.

React: https://github.com/facebook/react/blob/master/src/core/ReactDOM.js
JSX: https://github.com/facebook/react/blob/master/vendor/fbtransform/transforms/xjs.js

@cemerick
Copy link

There's two separate issues here: allowing people to easily produce components corresponding to nonstandard tags, and making it so that jsx knows about such things for a given project/codebase.

As someone that doesn't use jsx (and likely never will), addressing the former by simply exporting createDOMComponentClass would be a big immediate win for me, and may be for others in the same position as well. The latter issue is surely more challenging, but can be tackled later if deemed worthwhile.

@syranide
Copy link
Contributor

syranide commented Oct 8, 2014

@zpao @petehunt @sebmarkbage While I imagine 0.12 will make this happen, it does not address the issue of related attributes/properties that wouldn't be whitelisted right?

@sebmarkbage
Copy link
Collaborator

Correct, we'll get there for attributes too though.

@zpao
Copy link
Member

zpao commented Dec 10, 2014

At this point I think it's safe to say we'll never do this.

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

No branches or pull requests

9 participants