Skip to content

Commit

Permalink
hard coded react example
Browse files Browse the repository at this point in the history
  • Loading branch information
rzemlin committed Nov 11, 2023
0 parents commit 1ab44c5
Showing 1 changed file with 29 additions and 0 deletions.
29 changes: 29 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Hello React!</title>
</head>
<body>
<div id="root"></div>
<script src="https://unpkg.com/react@18/umd/react.development.js"></script>
<script src="https://unpkg.com/react-dom@18/umd/react-dom.development.js"></script>
<script>
function App() {
//const time = new Date().toLocaleTimeString();
const [time, setTime] = React.useState(new Date().toLocaleTimeString());
React.useEffect(function () {
setInterval(function () {
setTime(new Date().toLocaleTimeString());
}, 1000);
}, []);

return React.createElement("header", null, `Hello React! It's ${time}`);
}

const root = ReactDOM.createRoot(document.getElementById("root"));
root.render(React.createElement(App));
</script>
</body>
</html>

0 comments on commit 1ab44c5

Please sign in to comment.