Created
September 25, 2023 19:39
-
-
Save divs1210/6b920ec3b294321c97c590d6e288abed to your computer and use it in GitHub Desktop.
react-browser-starter
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"> | |
<title>Test React</title> | |
<head> | |
<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://unpkg.com/babel-standalone@6.15.0/babel.min.js"></script> | |
</head> | |
<body> | |
<div id="app"></div> | |
<script type="text/babel"> | |
const { useState } = React; | |
const { render } = ReactDOM; | |
function Component() { | |
let [count, setCount] = useState(0); | |
return ( | |
<h1 onClick={ _ => setCount(count + 1) }> | |
Hello React: { count } | |
</h1> | |
); | |
} | |
render(<Component />, document.getElementById('app')); | |
</script> | |
</body> | |
</html> |
Author
divs1210
commented
Sep 25, 2023
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment