Created
May 1, 2015 00:25
-
-
Save carlosdlf/d1db7985a46886e22fd9 to your computer and use it in GitHub Desktop.
React Children
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
/** | |
* Created by clarico on 30/04/2015. | |
*/ | |
var App = React.createClass({ | |
render:function(){ | |
return <Button>I <Heart/> React</Button> | |
} | |
}); | |
var Button = React.createClass({ | |
render:function(){ | |
return <button>{this.props.children}</button> | |
} | |
}); | |
var Heart = React.createClass({ | |
render:function(){ | |
return <span className="glyphicon glyphicon-heart"></span> | |
} | |
}); | |
React.render(<App/>, document.body); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment