Skip to content

Instantly share code, notes, and snippets.

@ayoisaiah
Created December 27, 2016 08:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ayoisaiah/bfc141dd4d78c053bc63f7e8ce6eb10c to your computer and use it in GitHub Desktop.
Save ayoisaiah/bfc141dd4d78c053bc63f7e8ce6eb10c to your computer and use it in GitHub Desktop.
Hello World in React!
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>Hello World!</title>
</head>
<body>
<main id="app">
</main>
<!-- React -->
<script src="https://fb.me/react-15.1.0.js"></script>
<script src="https://fb.me/react-dom-15.1.0.js"></script>
<!-- Babel -->
<script src="https://unpkg.com/babel-standalone@6/babel.min.js"></script>
<!-- Your code -->
<script type="text/babel">
var HelloWorld = React.createClass({
render: function () {
return (
<h1>Hello World!</h1>
);
}
});
//Renders our component output inside our `main` element with the id of "app"
ReactDOM.render(
<HelloWorld />, document.getElementById("app")
);
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment