-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathapp.js
More file actions
21 lines (19 loc) · 686 Bytes
/
app.js
File metadata and controls
21 lines (19 loc) · 686 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
const parent = React.createElement("div", { id: "parent" }, [
React.createElement("div", { id: "child" }, [
React.createElement("h1", { key: "h1key" }, "I am an h1 tag"),
React.createElement("h2", { key: "h2key" }, "I am an h2 tag"),
]),
React.createElement("div", { id: "child2" }, [
React.createElement("h1", { key: "h12key" }, "I am an h1 tag"),
React.createElement("h2", { key: "h22key" }, "I am an h2 tag"),
]),
]);
// JSX
// const heading = React.createElement(
// "h1",
// { id: "heading", xyz: "abc" },
// "Hello World from React"
// );
console.log(parent);
const root = ReactDOM.createRoot(document.getElementById("root"));
root.render(parent);