Skip to content

Instantly share code, notes, and snippets.

@joeytwiddle
Forked from RickWong/react.html
Created May 4, 2016 08:04
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 joeytwiddle/11a74c648792d85e9c965ef42d67a163 to your computer and use it in GitHub Desktop.
Save joeytwiddle/11a74c648792d85e9c965ef42d67a163 to your computer and use it in GitHub Desktop.
React without Webpack (using text/template)
<html>
<body>
<div id="react-root"></div>
<script src="https://cdnjs.cloudflare.com/ajax/libs/react/15.0.1/react-with-addons.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/react/15.0.1/react-dom.min.js"></script>
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/redux/3.5.2/redux.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/babel-standalone/6.7.7/babel.min.js"></script>
<script id="App" type="text/template">
const App = ({name}) => {
return <h1>Welcome to Redux, {name}</h1>;
};
ReactDOM.render(<App name="World" />, document.getElementById("react-root"));
</script>
<script>
eval(Babel.transform(document.getElementById("App").innerHTML, {presets: ['es2015', 'react']}).code);
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment