Skip to content

Support for custom DOM elements & attributes #2746

Closed
@Gozala

Description

@Gozala

Is there reason why React restricts you to just a subset of DOM elements and attributes ? Unfortunately it makes it really hard to use it with new HTML or non standard features unless support for that is added.

I noticed I could create custom elements via React.createFactory("custom")

https://github.com/facebook/react/blob/master/src/browser/ReactDOM.js#L30
https://github.com/facebook/react/blob/master/src/classic/element/ReactElement.js#L201-L209

But it's not documented & not sure if supported in long term. And even if it was supported that still does not solve problem of attributes as ones not listed in the docs seem to be ignored.

I think it would be good idea to allow defining custom virtual DOM Elements with a custom list of attributes so that users could implement them even if support for new element isn't in the core yet.

Finally support for namespaces would be super useful for using react even in more environments & should not be too hard either. I have successfully used vtree / vdom to do that.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions