diff --git a/src/helpers/apiRequests.ts b/src/helpers/apiRequests.ts index 8987047..e2eaa80 100644 --- a/src/helpers/apiRequests.ts +++ b/src/helpers/apiRequests.ts @@ -136,7 +136,7 @@ export const getAbout = (setState: React.Dispatch) => { .catch(); }; -export const getTeam = (setState: any) => { +export const getTeam = (setState: React.Dispatch) => { axios .get(players) .then((res) => { diff --git a/src/pages/Rating.tsx b/src/pages/Rating.tsx index 444f1c1..4c9589a 100644 --- a/src/pages/Rating.tsx +++ b/src/pages/Rating.tsx @@ -18,8 +18,19 @@ import useMediaQuery from "../hooks/useMediaQuery"; // Links import { hosting } from "../links"; +// Types +import { Player } from "../types/players"; + const Rating = () => { - const [players, setPlayers]: [any, React.Dispatch] = useState(); + const [players, setPlayers]: [Player[], React.Dispatch] = useState([ + { + id: -1, + name: "", + average: -1, + national: -1, + img: "", + }, + ]); useEffect(() => { window.scrollTo(0, 0); }, []); @@ -42,7 +53,7 @@ const Rating = () => {
- {players + {players[0].id !== -1 ? players.map((player: any) => { if (player.national === 0) { return (