-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.js
More file actions
43 lines (37 loc) · 813 Bytes
/
Copy pathindex.js
File metadata and controls
43 lines (37 loc) · 813 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
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
// const root = ReactDOM.createRoot(document.getElementById('root'));
// root.render(<h1>Hello there</h1>);
const root = ReactDOM.createRoot(document.getElementById('root'));
// function tick() {
// const time = new Date().toLocaleTimeString();
// const element = (
// <div>
// <h1>Ticking Example</h1>
// <h2>It's now {time}</h2>
// </div>
// );
// root.render(element);
// }
// setInterval(tick, 1000);
// Functional components:
const Fcom = (props) => {
return (
<div>
<h1>{props.name}</h1>
</div>
)
}
class Ccom extends React.Component{
constructor(props){
super(props)
}
render () {
return <h1>{this.props.address}</h1>
}
}
root.render(
<>
<Fcom name="NH Limon" />
<Fcom name={'Nahid Hasan Limon'} />
<Ccom address={'Barishal, Bangladesh'} />
</>
);