Skip to content
This repository has been archived by the owner on Feb 1, 2022. It is now read-only.

A better way to work with web components? #42

Closed
unbug opened this issue Jun 1, 2015 · 2 comments
Closed

A better way to work with web components? #42

unbug opened this issue Jun 1, 2015 · 2 comments

Comments

@unbug
Copy link

unbug commented Jun 1, 2015

Due to JSX's rule,we can't put a custom element in reactjs.For now I could come up the idea is

<div dangerouslySetInnerHTML={{__html:`
            <paper-button></paper-button>
            `}}/>

Is there a better way to do this?

@sophiebits
Copy link
Member

This should already work correctly in the latest version of React.

<div><paper-button></paper-button></div>

compiles to

React.createElement("div", null, React.createElement("paper-button", null))

and should render properly.

@unbug
Copy link
Author

unbug commented Jun 1, 2015

@spicyj I actually wont to get rid of the div wrap.Just

<paper-button></paper-button>

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

No branches or pull requests

2 participants