From 62481c6d234248deebf5f01c17508fd51130823b Mon Sep 17 00:00:00 2001
From: FifthWit <fifthwitbusiness@gmail.com>
Date: Thu, 30 Jan 2025 10:47:52 -0600
Subject: fixed rending issue with useCallback()

---
 frontend/src/components/Leaderboards.tsx | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

(limited to 'frontend/src/components/Leaderboards.tsx')

diff --git a/frontend/src/components/Leaderboards.tsx b/frontend/src/components/Leaderboards.tsx
index fb72f2b..801f331 100644
--- a/frontend/src/components/Leaderboards.tsx
+++ b/frontend/src/components/Leaderboards.tsx
@@ -1,4 +1,4 @@
-import React from 'react';
+import React, { useCallback } from 'react';
 import { Link, useNavigate } from 'react-router-dom';
 
 import { DownloadIcon, ThreedotIcon } from '@images/Images';
@@ -17,13 +17,13 @@ const Leaderboards: React.FC<LeaderboardsProps> = ({ mapID }) => {
   const [data, setData] = React.useState<MapLeaderboard | undefined>(undefined);
   const [pageNumber, setPageNumber] = React.useState<number>(1);
 
-  const _fetch_map_leaderboards = async () => {
+  const _fetch_map_leaderboards = useCallback(async () => {
     const mapLeaderboards = await API.get_map_leaderboard(
       mapID,
       pageNumber.toString()
     );
     setData(mapLeaderboards);
-  };
+  }, [mapID, pageNumber]);
 
   const { message, MessageDialogComponent } = useMessage();
 
-- 
cgit v1.2.3

