Skip to content

Commit 3d0443d

Browse files
committed
updated
1 parent b50a211 commit 3d0443d

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/app/initial-data/page.tsx

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,14 @@
11
import ListUsers from "./list-users";
22
import { User } from "../types";
33

4-
export default async function InitialData() {
4+
async function getUsers() {
55
const res = await fetch("https://jsonplaceholder.typicode.com/users");
66
const users = (await res.json()) as User[];
7+
return users;
8+
}
9+
10+
export default async function InitialData() {
11+
const users = await getUsers();
712

813
return <ListUsers users={users} />;
914
}

0 commit comments

Comments
 (0)