Skip to content

Commit 82c0a92

Browse files
committed
Update: getStaticPaths
1 parent 17d2741 commit 82c0a92

3 files changed

Lines changed: 16 additions & 1 deletion

File tree

react-query/front/components/PostForm.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ const PostForm = () => {
3939
},
4040
onSuccess() {
4141
setText('');
42+
setImagePaths([]);
4243
queryClient.refetchQueries('posts');
4344
},
4445
onSettled() {

react-query/front/pages/hashtag/[tag].tsx

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// hashtag/[tag].js
2-
import { GetStaticPropsContext } from 'next';
2+
import { GetStaticPathsContext, GetStaticPropsContext } from 'next';
33
import React, { useEffect } from 'react';
44
import { useInView } from 'react-intersection-observer';
55
import { dehydrate, QueryClient, useInfiniteQuery } from 'react-query';
@@ -52,6 +52,13 @@ const Hashtag = () => {
5252
);
5353
};
5454

55+
export const getStaticPaths = async () => {
56+
return {
57+
paths: [],
58+
fallback: true,
59+
};
60+
};
61+
5562
export const getStaticProps = async (context: GetStaticPropsContext) => {
5663
const queryClient = new QueryClient();
5764
const tag = context.params?.tag as string;

react-query/front/pages/user/[id].tsx

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,13 @@ const UserPosts = () => {
9090
);
9191
};
9292

93+
export const getStaticPaths = async () => {
94+
return {
95+
paths: [],
96+
fallback: true,
97+
};
98+
};
99+
93100
export const getStaticProps = async (context: GetStaticPropsContext) => {
94101
const queryClient = new QueryClient();
95102
const id = context.params?.id as string;

0 commit comments

Comments
 (0)