-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathApp.js
More file actions
24 lines (20 loc) · 895 Bytes
/
Copy pathApp.js
File metadata and controls
24 lines (20 loc) · 895 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
// <div id = "parent">
// <div id = "child">
// <h1>i am a h1 tag</h1>
// <h2>i am a h2 tag</h2>
// </div>
// </div>
// if you want to create a nested like above by the help of react
const parent = React.createElement("div" , {id: "parent"} ,
[React.createElement("div" , {id: "child"} ,
[React.createElement("h1" , {} , "i am a h1 tag"),React.createElement("h2" , {} , "i am a h2 tag")]
),React.createElement("div" , {id: "child2"} ,
[React.createElement("h1" , {} , "i am a h1 tag"),React.createElement("h2" , {} , "i am a h2 tag")]
)]
);
console.log(parent);
const root = ReactDOM.createRoot(document.getElementById("root"));
root.render(parent);
// const heading = React.createElement("h1",{id: "heading"},"Hello World From React");
// const root = ReactDOM.createRoot(document.getElementById("root"));
// root.render(heading);