-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.js
42 lines (39 loc) · 1.07 KB
/
index.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
import React, { useState, useEffect } from 'react';
import { render } from 'react-dom';
import CustomHook from './CustomHook';
function App() {
const users = CustomHook("https://jsonplaceholder.typicode.com/users");
console.log(users)
return (
<div>
<div class="container">
<div class="jumbotron">
<h1>Custom Hooks Example</h1>
</div>
<div>
<table class="table table-hover">
<thead>
<tr>
<th>Name</th>
<th>User name</th>
<th>Email</th>
<th>Website</th>
</tr>
</thead>
<tbody>
{users.map((item, index) => {
return (<tr key={index}>
<td>{item.name}</td>
<td>{item.username}</td>
<td>{item.email}</td>
<td>{item.website}</td>
</tr>)
})}
</tbody>
</table>
</div>
</div>
</div>
);
}
render(<App />, document.getElementById('root'));