-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathnotes.txt
More file actions
70 lines (57 loc) · 1.76 KB
/
notes.txt
File metadata and controls
70 lines (57 loc) · 1.76 KB
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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
Props
Props are short for properties.
It is a React built-in object which stores the value of a tag’s attributes and
works similar to the HTML attributes. It provides a way to pass data from one
component to other components in the same way as arguments are passed in a function.
• Functional Components: These components have no state of their own. and
only contain a render method, so they are also called stateless components.
They may derive data from other components as props (properties).
function Greeting(props) {
return <h1>Welcome to {props.name}</h1>;
}
Akshara Xworkz5:03 PM //-------------------------------------
import Personal from "./Personal";
import Address from "./Address";
function EmpContainer() {
const empName = ["Sindhu", 'Arun', 'kumar'];
const eid = ["WipHCl980", 'hj7', '908'];
const skills = ['java', 'react', 'html'];
const addres={
place:'hassan',
pin:9870
}
const addres1={
place:'Shimoga',
pin:43235
}
return (
<div>
<h1>Employee Information</h1>
<Personal
empName={emp
ReactDOM.render(<EmpContainer/>,
document.getElementById('root')
);
--------------------------------------------------------------
function Address(props) {
console.log(props);
return (
<div>
<h2>Display Address info</h2>
<h3>Place:{props.addres.place}</h3>
<h3>Picode:{props.addres.pin}</h3>
</div>
)
}
export default Address;
-------------------------------------------------------------
function Personal(props) {
return (
<div>
<h2>Display Personal info</h2>
<h2>Name:{props.empName}</h2>
<h2>EID:{props.eid}</h2>
</div>
)
}
export default Personal;