Created
October 20, 2018 13:07
-
-
Save valex/ba689785c4c64866a99e026c1db10422 to your computer and use it in GitHub Desktop.
React Hello World
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>hello React</title> | |
<meta charset="utf-8"> | |
</head> | |
<body> | |
<div id="app"> | |
<!-- my app renders here --> | |
</div> | |
<script crossorigin src="https://cdnjs.cloudflare.com/ajax/libs/babel-standalone/6.26.0/babel.min.js"></script> | |
<script crossorigin src="https://unpkg.com/react@16/umd/react.development.js"></script> | |
<script crossorigin src="https://unpkg.com/react-dom@16/umd/react-dom.development.js"></script> | |
<script type="text/babel"> | |
const headStyle = { | |
color: 'blue', | |
background: 'black', | |
fontFamily: 'Verdana', | |
}; | |
const element = <h1 style={headStyle} className="pretty" id="my-heading"><span><em>Hell</em>o, world</span></h1>; | |
ReactDOM.render(element, document.getElementById('app')); | |
</script> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment