Skip to content

Commit 0e1fe63

Browse files
committed
Update YamlViewer.tsx
1 parent eb5a125 commit 0e1fe63

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/components/Yaml/YamlViewer.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,8 @@ export const YamlViewer: FC<YamlViewerProps> = ({ yamlString, filename, yamlStri
4646
)}
4747
</FlexBox>
4848

49-
<YamlEditor key={yamlString} height="90vh" defaultValue={yamlString} />
49+
{/* Use controlled value with a stable model path to update content without remounting */}
50+
<YamlEditor height="90vh" value={yamlString} path={`${filename}.yaml`} options={{ readOnly: true }} />
5051
</div>
5152
);
5253
};

0 commit comments

Comments
 (0)