Skip to content

Instantly share code, notes, and snippets.

@Badestrand Badestrand/react-mini.html
Last active Nov 20, 2018

Embed
What would you like to do?
Simple React in browser
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title></title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<style rel="stylesheet" type="text/less">
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
main {
width: 800px;
margin: 50px auto;
}
</style>
<script src="https://cdnjs.cloudflare.com/ajax/libs/less.js/2.5.3/less.min.js"></script>
</head>
<body>
<div id="app"></div>
<script src="https://unpkg.com/react@16/umd/react.development.js"></script>
<script src="https://unpkg.com/react-dom@16/umd/react-dom.development.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/babel-core/5.8.24/browser.min.js"></script>
<script type="text/babel">
class App extends React.Component {
render() {
return (
<main>
<h1>Hello!</h1>
</main>
)
}
}
ReactDOM.render(<App/>, document.getElementById('app'))
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.