-
Notifications
You must be signed in to change notification settings - Fork 0
/
react.html
45 lines (42 loc) · 1.06 KB
/
react.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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
<!DOCTYPE html>
<html lang="en" dir="ltr">
<head>
<meta charset="utf-8" />
<script
src="https://unpkg.com/react@18/umd/react.development.js"
crossorigin
></script>
<script
src="https://unpkg.com/react-dom@18/umd/react-dom.development.js"
crossorigin
></script>
<script src="https://unpkg.com/@babel/standalone/babel.min.js"></script>
<title>Intro to React</title>
</head>
<body>
<div id="react-container"></div>
<script type="text/babel">
const App = () => {
return (
<>
<h1>Hello World!</h1>
<Foxtrot/>
<Foxtrot/>
<Foxtrot/>
<Foxtrot/>
<Foxtrot />
<Foxtrot />
<Foxtrot />
<Foxtrot />
</>
);
};
const Foxtrot = () => {
return <h2> Hey Foxtrot!!</h2>;
};
const domContainer = document.querySelector("#react-container");
const root = ReactDOM.createRoot(domContainer);
root.render(<App />);
</script>
</body>
</html>