Skip to content

Instantly share code, notes, and snippets.

@nilshartmann
Created July 1, 2015 08:37
Show Gist options
  • Save nilshartmann/fb68c34a461d922cd86c to your computer and use it in GitHub Desktop.
Save nilshartmann/fb68c34a461d922cd86c to your computer and use it in GitHub Desktop.
Using babel browser.js to compile ES6 and JSX code
<!DOCTYPE html>
<html>
<head>
<script src="./react-0.13.3.min.js"></script>
<script src="./browser.min.js"></script>
</head>
<body>
<div id="mount"></div>
</body>
<script type="text/babel">
class MessageComponent extends React.Component {
render() {
return <h1>Hello World!</h1>;
}
}
React.render(<MessageComponent />, document.getElementById('mount'));
</script>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment