작성
·
442
0
react-query ssr 설정하기인데 어느 부분이 ssr 설정인지 잘모르겠습니다 어느부분인가요??
export async function getPostRecommends({ pageParam }: Props) {
const res = await fetch(
`http://localhost:9090/api/postRecommends?cursor=${pageParam}`,
{
next: {
tags: ["posts", "recommends"],
},
}
);
// The return value is *not* serialized
// You can return Date, Map, Set, etc.
if (!res.ok) {
// This will activate the closest `error.js` Error Boundary
throw new Error("Failed to fetch data");
}
return res.json();
}