-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathSecond.tsx
42 lines (38 loc) · 1.23 KB
/
Second.tsx
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
import React from "react";
interface IProps{
key1 : string;
key2: number;
key3: boolean;
key4: any[];
}
interface IState{}
class Second extends React.Component<IProps,IState>{
constructor(props:IProps){
super(props);
}
render() {
return (
<React.Fragment>
<h1>{this.props.key1}</h1>
<h1>{this.props.key2}</h1>
<h1>{JSON.stringify(this.props.key3)}</h1>
<table>
<tr>
<th>Name</th>
<th>City</th>
<th>Country</th>
</tr>
{this.props.key4.map((element:any,index:number)=>(
<tr key={index}>
<td>{index+1}</td>
<td>{element.Name}</td>
<td>{element.City}</td>
<td>{element.Country}</td>
</tr>
))}
</table>
</React.Fragment>
)
}
}
export default Second;