Last active
January 27, 2019 23:18
-
-
Save a7ul/c0ca14e9092532cc99a3f9f77ca5ec71 to your computer and use it in GitHub Desktop.
react-webcomponentify-examples-my-button.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from "react"; | |
import { registerAsWebComponent } from "react-webcomponentify"; | |
const MyComplexComponent = props => ( | |
<div> | |
Kinda complex component 😂 | |
<p>{props.text}</p> | |
<div>{props.children}</div> | |
</div> | |
); | |
registerAsWebComponent(MyComplexComponent, "my-complex-component"); | |
/* | |
In html: | |
<my-complex-component text="component with children"> | |
<p> I am a child element</p> | |
<div> I am another childish | |
<button>button</button> | |
</div> | |
</my-complex-component> | |
*/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment