Created
September 8, 2017 06:54
-
-
Save alexkrolick/8e62fd0dc3630d847a5132d26bf3d408 to your computer and use it in GitHub Desktop.
This file contains hidden or 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, { Component, createElement as h } from 'react' | |
const Foo = ({text, ...props}) => h("span", props, text) | |
const Bar = props => h("div", {}, | |
h(Foo, { ...props, style: "color: blue" }) | |
) | |
class Baz extends Component { | |
constructor(props) { | |
super(props) | |
this.state = { text: 'Baz-text' } | |
} | |
render() { | |
return h(Bar, { text: this.state.text }) | |
} | |
} | |
render(h(Baz), document.body) |
This file contains hidden or 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
<div> | |
<span style="color: blue;"> | |
Baz-text | |
</span> | |
</div> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment