diff --git a/src/Events.js b/src/Events.js index ff80a3a..c4c4970 100644 --- a/src/Events.js +++ b/src/Events.js @@ -115,10 +115,12 @@ export default function Events() { const [events, setEvents] = useState(null) useEffect(async () => { - const res = await fetch(endpoint, fetch_options) - const result = await res.json() - setEvents(result) - }, []) + if (events === null) { + const res = await fetch(endpoint, fetch_options) + const result = await res.json() + setEvents(events) + } + }, [events]) if (events === null) { return

Laster arrangement...