-
Notifications
You must be signed in to change notification settings - Fork 16
/
Copy pathindex.html
29 lines (24 loc) · 1.16 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
<html>
<body>
<div id="root"></div>
<script type="module">
// 🐨 add imports for react and react-dom/client here
// 💰 import { createElement } from '/react.js'
// 💰 import { createRoot } from '/react-dom/client.js'
const rootElement = document.getElementById('root')
// You're going to re-implement this code using React!
// 💣 So go ahead and delete this implementation (or comment it out for now)
// These three lines are similar to createElement
// 📜 https://react.dev/reference/react/createElement
const element = document.createElement('div')
element.className = 'container' // 💰 in React, this is also called the "className" prop
element.textContent = 'Hello World' // 💰 in React, this is the "children" prop or a third argument
// This is similar to createRoot().render()
rootElement.append(element)
// 🐨 Please replace all the DOM-related code above with React API calls
// 💰 The example in the markdown file should be a good hint for you.
</script>
<!-- this is here to add automatic browser reloading as you save your work -->
<script type="module" src="epic_ws.js"></script>
</body>
</html>