Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@alansmithy
Last active July 4, 2019 10:46
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 alansmithy/43983f4f4ed21fc3bfa8ec2ebe0e88e4 to your computer and use it in GitHub Desktop.
Save alansmithy/43983f4f4ed21fc3bfa8ec2ebe0e88e4 to your computer and use it in GitHub Desktop.
Basic react
license: mit
<!DOCTYPE html>
<head>
<meta charset="utf-8">
<script src="https://unpkg.com/@babel/standalone/babel.min.js"></script>
<script
src="https://unpkg.com/react@16/umd/react.production.min.js"
crossorigin></script>
<script
src="https://unpkg.com/react-dom@16/umd/react-dom.production.min.js"
crossorigin></script>
</head>
<body>
<div id="app"></div>
<script type="text/babel">
const MyComponent = (props) => (<div>Hi {props.name}!!</div>);
const App = (props) => (<div><h1>My App</h1><MyComponent name={props.somebody}/></div>)
ReactDOM.render(
<App somebody="Alan" />,
document.getElementById('app')
);
</script>
</body>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment