-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathApp.js
37 lines (29 loc) · 897 Bytes
/
App.js
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
/***
* <div>
* div
* h1
* h1
* div
* h2
* h2
* </div>
*
*/
import React from "react";
import ReactDOM from "react-dom/client";
const parent = React.createElement("div", { id: "parent" }, [React.createElement("div",
{ id: "sub-parent-1" },
[React.createElement("h1", {}, "H1 header 1"),
React.createElement("h1", {}, "Namaste react 🚀 ")]), React.createElement("div",
{ id: "sub-parent2" },
[React.createElement("h2", {}, "H1 header 1"),
React.createElement("h2", {}, "H1 header 2")])]);
const heading = React.createElement(
"h1", { id: "heading", xyz: "abc" },
"Hello wold react!!"
);
console.log(parent);
const root = ReactDOM.createRoot(document.getElementById("root"));
root.render(parent);
const root1 = ReactDOM.createRoot(document.getElementById("root1"));
root1.render(heading);