-
Notifications
You must be signed in to change notification settings - Fork 0
/
App2.jsx
42 lines (40 loc) · 863 Bytes
/
App2.jsx
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
/**
* In this we will discuss the concepts of ReactJS Components
*/
import React from 'react';
/**
* Stateless example
* App is owner of Header and Content
* Creating Header and Content separately and adding them inside JSX tree in App component
* Only App component needs to be exported
*/
class App2 extends React.Component {
render() {
return (
<div>
<Header />
<Content />
</div>
);
}
}
class Header extends React.Component {
render() {
return (
<div>
<h1>Header</h1>
</div>
);
}
}
class Content extends React.Component {
render() {
return (
<div>
<h2>Content</h2>
<p>The content text!!!</p>
</div>
);
}
}
export default App2;