-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathOldApp.js
53 lines (43 loc) · 1.09 KB
/
OldApp.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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
import React from "react";
import ReactDOM from "react-dom/client";
/**
* Create following pattern
* <div id="parent" >
* <div id="child">
* <h1>Hello I am h1 tag </h1>
* <h2>Hello I am h2 tag </h2>
* </div>
* </div>
*/
const title = (
<h1>hello I am title</h1>
)
const HeadingComponent = () => <h1 className="page-heading" >This is page heading</h1>
const PageComponent = () => {
return (
<div id="container">
<HeadingComponent />
<div style={{"height": "200px", "background":"yellow"}}>
<h2>page content comes here</h2>
</div>
</div>
)
}
const parent = React.createElement(
"div",
{ id: "parent" },
React.createElement("div", { id: "child" }, [
React.createElement("h1", {}, "I am H1 tag as one"),
React.createElement("h1", {}, "I am H2 tag"),
])
);
const heading = React.createElement(
"h1",
{ id: "head" },
"hello world from react !"
);
// const root = ReactDOM.createRoot(document.getElementById("root"));
// root.render(heading);
// root.render(parent)
// root.render(parent)
// root.render(<PageComponent/>)