Skip to content

Instantly share code, notes, and snippets.

@iwilsonq
Last active March 11, 2017 23:11
Show Gist options
  • Save iwilsonq/0f5a2394def72ea5c3cd4a5841c91fee to your computer and use it in GitHub Desktop.
Save iwilsonq/0f5a2394def72ea5c3cd4a5841c91fee to your computer and use it in GitHub Desktop.
<!doctype HTML>
<html>
<head>
<title>React Ecosystem</title>
</head>
<body>
<div id="react-root"></div>
<script src="bundle.js"></script>
</body>
</html>
// 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