Refactor: 리랜더링을 위한 key 설정

This commit is contained in:
정현조 2024-09-30 13:18:03 +09:00
parent a16ba44776
commit 4dee5fc1d2

View File

@ -56,6 +56,7 @@ export default function TrainingTab({ projectId }: TrainingTabProps) {
return ( return (
<div className="grid grid-rows-[auto_1fr] gap-8 md:grid-cols-2"> <div className="grid grid-rows-[auto_1fr] gap-8 md:grid-cols-2">
<TrainingSettings <TrainingSettings
key={selectedModel?.isTrain ? 'training' : 'settings'}
projectId={numericProjectId} projectId={numericProjectId}
selectedModel={selectedModel} selectedModel={selectedModel}
setSelectedModel={setSelectedModel} setSelectedModel={setSelectedModel}
@ -65,6 +66,7 @@ export default function TrainingTab({ projectId }: TrainingTabProps) {
className="h-full" className="h-full"
/> />
<TrainingGraph <TrainingGraph
key={selectedModel?.isTrain ? 'training' : 'graph'}
projectId={numericProjectId} projectId={numericProjectId}
selectedModel={selectedModel} selectedModel={selectedModel}
className="h-full" className="h-full"