Skip to content

Commit

Permalink
fix: suspense query 리랜더링 막기
Browse files Browse the repository at this point in the history
  • Loading branch information
JaeHongDev committed Jul 8, 2024
1 parent 3ccdaa4 commit 5efb475
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ interface QuestionSetItemProps {
}

const QuestionSetItem = ({questionSet:{questionSetId, title, description, tailQuestionDepth, count, thumbnailUrl}, openInterviewSetting}: QuestionSetItemProps) => {

const handleOpenSettings = useCallback(() => {
openInterviewSetting({
questionSetId,
Expand Down
14 changes: 10 additions & 4 deletions frontend/src/hooks/api/interview/useInterviewQuestionLoadQuery.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,20 @@ import {loadByCurrentInterviewQuestion} from "@/api/interview/LoadByCurrentInter

export const useInterviewQuestionLoadQuery = (interviewId: number) => {
// TODO: 변수명 바꾸기
const {data: interview, refetch, error, isFetching} = useSuspenseQuery({
const { data: interview, refetch, error, isFetching } = useSuspenseQuery({
queryKey: ['loadInterviewQuestion', interviewId],
queryFn: () => loadByCurrentInterviewQuestion(interviewId),
gcTime: 60 * 60 * 10,
staleTime: 60* 60 * 10
refetchOnWindowFocus:false,
gcTime: Infinity,
staleTime: Infinity
});

return {interview, refetch, error, isLoading: isFetching}
return {
interview,
refetch,
error,
isLoading: isFetching
};
}


Expand Down

0 comments on commit 5efb475

Please sign in to comment.