We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 69c4233 commit e5ccc7cCopy full SHA for e5ccc7c
1 file changed
app/blogs/page.tsx
@@ -68,11 +68,17 @@ async function getBlogs(page: number = 1): Promise<BlogResponse> {
68
return data;
69
}
70
71
-export default async function BlogsPage({
72
- searchParams,
73
-}: {
74
- searchParams?: { [key: string]: string | undefined };
75
-}) {
+interface SearchParamsType {
+ [key: string]: string | string[] | undefined;
+ page?: string;
+}
+
76
+interface PageProps {
77
+ searchParams?: Promise<SearchParamsType>;
78
79
80
+export default async function BlogsPage(props: PageProps) {
81
+ const searchParams = (await (props.searchParams || Promise.resolve<SearchParamsType>({ page: "1" })));
82
const currentPage = Number(searchParams?.page) || 1;
83
const data = await getBlogs(currentPage);
84
const blogs = data?.data?.user?.posts?.edges || [];
0 commit comments