Skip to content

Instantly share code, notes, and snippets.

@oychao
Created February 3, 2020 02:49
Show Gist options
  • Save oychao/b613d13a22e50881dff5b504e2055b93 to your computer and use it in GitHub Desktop.
Save oychao/b613d13a22e50881dff5b504e2055b93 to your computer and use it in GitHub Desktop.
React Demo HTML Doc
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>React Demo</title>
<script src="https://unpkg.com/@babel/standalone/babel.min.js"></script>
<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>
</head>
<body>
<div id="app"></div>
<script type="text/babel">
console.log(React);
const Counter = () => {
React.useEffect(() => {
console.log('counter done');
});
return <hr />;
};
const App = () => {
React.useEffect(() => {
console.log('app done');
});
return <div><h5>&copy;</h5><Counter /></div>;
};
// class App extends React.Component {
// render() {
// return <div><h5>&copy;</h5><Counter /></div>;
// }
// }
ReactDOM.render(<App />, document.querySelector('#app'));
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment