add missing dep in usememo

This commit is contained in:
PhilReact 2024-12-31 21:23:21 +02:00
parent 722338d3ea
commit ae733da906
4 changed files with 6 additions and 6 deletions

View File

@ -1,4 +1,4 @@
import React, { useEffect, useMemo, useState } from "react"; import React, { useCallback, useEffect, useMemo, useState } from "react";
import ReactGA from "react-ga4"; import ReactGA from "react-ga4";
import "./App.css"; import "./App.css";
import socketService from "./services/socketService"; import socketService from "./services/socketService";
@ -256,7 +256,7 @@ function App() {
}; };
}, [userInfo?.address]); }, [userInfo?.address]);
const getCoinLabel = (coin?: string)=> { const getCoinLabel = useCallback((coin?: string)=> {
switch(coin || selectedCoin){ switch(coin || selectedCoin){
case "LITECOIN":{ case "LITECOIN":{
@ -285,7 +285,7 @@ function App() {
default: default:
return null return null
} }
} }, [selectedCoin])
const gameContextValue: IContextProps = { const gameContextValue: IContextProps = {
userInfo, userInfo,

View File

@ -218,7 +218,7 @@ export const TradeOffers: React.FC<any> = ({ foreignCoinBalance }: any) => {
}, },
}, },
]; ];
}, [qortalNames]); }, [qortalNames, getCoinLabel]);
// const onRowClicked = (event: any) => { // const onRowClicked = (event: any) => {
// if(listOfOngoingTradesAts.includes(event.data.qortalAtAddress)) return // if(listOfOngoingTradesAts.includes(event.data.qortalAtAddress)) return

View File

@ -136,7 +136,7 @@ export default function HistoryList({ qortAddress, historyList }) {
}, },
]; ];
}, [selectedCoin, qortalNames]) }, [selectedCoin, qortalNames, getCoinLabel])

View File

@ -101,7 +101,7 @@ export default function TradeBotList({ qortAddress, failedTradeBots }) {
resizable: true, resizable: true,
}, },
]; ];
}, [selectedCoin]); }, [selectedCoin, getCoinLabel]);
useEffect(() => { useEffect(() => {
if (qortAddress) { if (qortAddress) {
qortAddressRef.current = qortAddress; qortAddressRef.current = qortAddress;