Skip to content

Commit 0fbd697

Browse files
fix: Remove fileUpload dep in useStacValue useEffect (#177)
So when reviewing the error boundary PR #176 which I did a couple of days ago.. apologies for not approving and bringing this up sooner but I realized the app looked like it was infinitely rendering.. Is this supposed to happen?? If not, I went down a path trying to figure out where this was happening. It looked like the `useStacValue` hook's useEffect had a dep `fileUpload` which is hook from chakra that was causing this. This PR just removes that dep to stop the app from infinitely rendering. But maybe this could be solved another way? Either way, I dont think this should cause a big issue having that missing dep as I think it will still be stable enough. What do you think @gadomski? -------------------- **Behavior before (infinite render):** https://github.com/user-attachments/assets/d895a717-b039-4cf6-a59c-c963f7a2ee44 **Behavior now:** https://github.com/user-attachments/assets/0dcda900-f47b-4485-9b35-663a71e13222
1 parent 9f5438f commit 0fbd697

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/hooks/stac-value.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ export default function useStacValue({
4343
setConnection(connection);
4444
})();
4545
}
46-
}, [db, href, fileUpload]);
46+
}, [db, href, fileUpload.acceptedFiles]);
4747

4848
const jsonResult = useQuery<StacValue | null>({
4949
queryKey: ["stac-value", href],

0 commit comments

Comments
 (0)