diff options
Diffstat (limited to 'frontend/src/Path.js')
| -rw-r--r-- | frontend/src/Path.js | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/frontend/src/Path.js b/frontend/src/Path.js index f375743..3fd50ea 100644 --- a/frontend/src/Path.js +++ b/frontend/src/Path.js @@ -1,9 +1,10 @@ import React from 'react'; -import usePolling from './usePolling'; +import useSSE from './useSSE'; import DataDisplay from './DataDisplay'; // Import the DataDisplay component const Path = () => { - const { data, error } = usePolling('http://localhost:8000/route', 1000); + const { data: sseData, error } = useSSE('http://localhost:8000/data_stream'); + const data = sseData ? sseData.route : null; return ( <div className="text-white"> |
