Skip to content

Instantly share code, notes, and snippets.

@fourdollars
Last active March 17, 2017 11:25
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 fourdollars/8a7c347d55a62e5ac4b78994147a0dde to your computer and use it in GitHub Desktop.
Save fourdollars/8a7c347d55a62e5ac4b78994147a0dde to your computer and use it in GitHub Desktop.
class MachineBox extends React.Component {
render(){
return ( <div>Hello From React </div> );
}
}
let target = document.getElementById('machine-box');
ReactDOM.render(
<MachineBox />, target
)
<!DOCTYPE html>
<html>
<head>
<!-- Prevent from UTF-8 issue https://github.com/babel/babel/issues/340 -->
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<!-- React -->
<script src="https://unpkg.com/react@15/dist/react.min.js"></script>
<!-- React DOM -->
<script src="https://unpkg.com/react-dom@15/dist/react-dom.min.js"></script>
<!-- babel core-->
<script src="https://unpkg.com/babel-standalone@6/babel.min.js"></script>
</head>
<body>
<div id="machine-box"></div>
<script type="text/babel" src="components.js" data-presets="es2015,react"></script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment