We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent b50a211 commit 3d0443dCopy full SHA for 3d0443d
src/app/initial-data/page.tsx
@@ -1,9 +1,14 @@
1
import ListUsers from "./list-users";
2
import { User } from "../types";
3
4
-export default async function InitialData() {
+async function getUsers() {
5
const res = await fetch("https://jsonplaceholder.typicode.com/users");
6
const users = (await res.json()) as User[];
7
+ return users;
8
+}
9
+
10
+export default async function InitialData() {
11
+ const users = await getUsers();
12
13
return <ListUsers users={users} />;
14
}
0 commit comments