Created
February 3, 2020 02:49
-
-
Save oychao/b613d13a22e50881dff5b504e2055b93 to your computer and use it in GitHub Desktop.
React Demo HTML Doc
This file contains 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 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>©</h5><Counter /></div>; | |
}; | |
// class App extends React.Component { | |
// render() { | |
// return <div><h5>©</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