Skip to content

Commit f111788

Browse files
committed
エディタに変更が反映されないことがあるのを修正
1 parent ea09c9d commit f111788

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

app/terminal/file.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,8 @@ export function FileProvider({ children }: { children: ReactNode }) {
4141
setFiles((files) => {
4242
if (files[pathname][name] !== content) {
4343
files[pathname][name] = content;
44+
// Reactが変更を検知できるようfiles[pathname]をコピーした別オブジェクトに置き換え
45+
files[pathname] = {...files[pathname]};
4446
return { ...files };
4547
} else {
4648
return files;

0 commit comments

Comments
 (0)