-
-
Save mxriverlynn/4a7a6c4a899279d9c80b to your computer and use it in GitHub Desktop.
react component
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
'use strict'; | |
let Hello = function (props) { | |
return { | |
props, // set props | |
render () { | |
// get `word` from props obj with | |
// es6 destructuring: | |
const { word } = this.props; | |
return ( | |
// Fill in the { blanks } | |
<p>Hello, { word }!</p> | |
); | |
} | |
}; | |
}; | |
export default Hello; |
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
<script type="text/jsx"> | |
var word = 'puppy'; | |
var content = document.getElementById("content"); | |
React.render ( | |
<Hello word={ word } />, | |
content | |
); | |
</script> | |
<div id="content"></div> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment