I agree this should be available and documented.
+1 to that. At the moment adding the missing svg tags is a bit pokey.
FWIW, this won't help the JSX transformer which maintains it's own list of tags it recognizes and converts to React.DOM.*
@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.
@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.
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.
@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?
Correct, we'll get there for attributes too though.
At this point I think it's safe to say we'll never do this.
Related Issues (20)
- Add in-built styling capability of React Components HOT 3
- Is there any way you can provide a code sample that reproduces the problem? That error should only occur if there's a bug in React, so it'd be very helpful if we could reproduce.
- Bug: HOT 1
- form fields with different type but no key get reused when re-rendering HOT 3
- [DevTools Bug]: HOT 1
- Bug: forwardRef provides an empty object as ref, causing `can't define property "current"` error.
- Bug: HOT 2
- unable to run examples in React tictactoe tutorial HOT 4
- Bug: React css module class name generation doesn't work HOT 1
- Bug: `react-dom-webpack-server` bundles are currently broken on `main` HOT 6
- Bug: Changes made to an array in useState also affect its copy HOT 3
- RSC: How to realize shared code with client-specific execution results
- [DevTools Bug]: 'Unable to find React on the page' in incognito on Firefox HOT 1
- eslint react-hooks/rulesOfHooks: add rule to check for non-function return from useEffect HOT 2
- [DevTools Bug] Cannot add child "1161" to parent "942" because parent node was not found in the Store.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.