import './App.css'; import React, { useState, useEffect } from 'react'; function App() { const [activeGames, setActiveGames] = useState(null); useEffect(() => { fetch('/api/activegames') .then((response) => response.json()) .then((games) => { console.log(games.ActiveGames.length); console.log("games: " +games.ActiveGames); setActiveGames(games.ActiveGames); }) .catch((err) => { console.log(err.message); }); }, []); return (
Here is list of your active games: {activeGames ? {activeGames} : Loading...}