chore: fixed merge request suggestion for adding depency array

This commit is contained in:
Björn Otgaar
2025-11-11 11:42:28 +01:00
parent df4346150e
commit 87cf723c95

View File

@@ -4,8 +4,6 @@ export default function ConnectedRobots() {
const [connected, setConnected] = useState<boolean | null>(null); const [connected, setConnected] = useState<boolean | null>(null);
useEffect(() => { useEffect(() => {
// We're excepting a stream of data like that looks like this: `data = False` or `data = True` // We're excepting a stream of data like that looks like this: `data = False` or `data = True`
const eventSource = new EventSource("http://localhost:8000/robot/ping_stream"); const eventSource = new EventSource("http://localhost:8000/robot/ping_stream");
@@ -29,7 +27,7 @@ export default function ConnectedRobots() {
} }
}; };
return () => eventSource.close(); return () => eventSource.close();
}); }, []);
return ( return (
<div> <div>