diff --git a/src/App.js b/src/App.js index b71a010..e2d9425 100644 --- a/src/App.js +++ b/src/App.js @@ -33,12 +33,12 @@ const App = () => { if (audioElmRef.current) { await audioElmRef.current.play() } - }), + }, [audioElmRef]), pause = useCallback(async () => { if (audioElmRef.current) { await audioElmRef.current.pause() } - }), + }, [audioElmRef]), loadData = () => { fetch('/stream.json').then(response => response.json()).then(json => { setJson(json) @@ -58,6 +58,8 @@ const App = () => { setMaxListeners(listeners[i].textContent) } } + }).catch(err => { + console.error('Error fetching data: ' + err.message) }) } useEffect(() => {