Last active
March 11, 2017 23:11
-
-
Save iwilsonq/0f5a2394def72ea5c3cd4a5841c91fee to your computer and use it in GitHub Desktop.
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
<!doctype HTML> | |
<html> | |
<head> | |
<title>React Ecosystem</title> | |
</head> | |
<body> | |
<div id="react-root"></div> | |
<script src="bundle.js"></script> | |
</body> | |
</html> |
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
// Necessary imports | |
import React from 'react'; | |
import ReactDOM from 'react-dom'; | |
// React component declared with 'createClass' | |
const FirstComponent = React.createClass({ | |
// Every react component must have a render function | |
render: function() { | |
return ( | |
<div className="first"> | |
<h1>My first Component</h1> | |
</div> | |
); | |
} | |
}); | |
// This function 'hooks' into our index.html | |
ReactDOM.render( | |
<FirstComponent />, | |
document.getElementById('react-root') | |
); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment