Skip to content

Commit

Permalink
🐛 suspense 와 동시에 사용 하면 오류 발생 (#73-5)
Browse files Browse the repository at this point in the history
  • Loading branch information
jaewoong2 committed Oct 30, 2022
1 parent 0a570af commit 3694106
Showing 1 changed file with 5 additions and 8 deletions.
13 changes: 5 additions & 8 deletions src/pages/Order/components/blocks/Order.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
import React from 'react'
import React, { useMemo } from 'react'
import { NavigationWithArrow } from '@/components/blocks'
import { Layout } from '@/components'
import useGetTemplate from '@/hooks/useGetTemplate'
import { useParams } from 'react-router-dom'
import LoadingPage from '@/components/molecules/LoadingPage'
import QuestionDescription from '../molecules/QuestionDescription'
import QuestionOption from '../molecules/QuestionOption'
import Stepper from '../molecules/Stepper'
Expand All @@ -17,15 +16,11 @@ const Order = () => {
const { handleChangeCheckbox, handleChangeRadio, handleChangeTextArea, handleClickStep } =
useOrderActionContext()

const { data: template, isLoading } = useGetTemplate(id ?? '', {
const { data: template } = useGetTemplate(id ?? '', {
enabled: false,
})

if (isLoading) {
return <LoadingPage />
}

const content = template?.contentList[current]
const content = useMemo(() => template?.contentList[current], [current, template])

return (
<Layout navigtaion={<NavigationWithArrow>{template?.title}</NavigationWithArrow>}>
Expand All @@ -39,6 +34,7 @@ const Order = () => {
<form className="w-full">
{content && content.type !== 'subjective' && (
<QuestionOption
name={content.question}
img={content.img}
detailType={content.type}
answer={order.answers[current]}
Expand All @@ -53,6 +49,7 @@ const Order = () => {
)}
{content?.type === 'subjective' && (
<QuestionDescription
name={content.question}
img={content.img}
questionTitle={`${content?.required ? '(*)' : ''} ${content.question}`}
handleChangeDescription={handleChangeTextArea(current)}
Expand Down

0 comments on commit 3694106

Please sign in to comment.