Skip to content

Instantly share code, notes, and snippets.

@nobuti
Created October 19, 2017 10:08
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nobuti/78cb252fe5dbadc054d7ac1fd31b428e to your computer and use it in GitHub Desktop.
Save nobuti/78cb252fe5dbadc054d7ac1fd31b428e to your computer and use it in GitHub Desktop.
Almost pure React
<html>
<body>
<div id="react-root"></div>
<script src="https://cdnjs.cloudflare.com/ajax/libs/react/16.0.0/umd/react.production.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/react-dom/16.0.0/umd/react-dom.production.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/babel-standalone/6.26.0/babel.min.js"></script>
<script id="react-app" type="text/template">
const App = ({name}) => {
return <h1>Welcome to React, {name}</h1>;
};
ReactDOM.render(<App name="Buddy" />, document.getElementById("react-root"));
</script>
<script>
eval(Babel.transform(document.getElementById("react-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