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 "./App.css";
import socketService from "./services/socketService";
@ -256,7 +256,7 @@ function App() {
};
}, [userInfo?.address]);
const getCoinLabel = (coin?: string)=> {
const getCoinLabel = useCallback((coin?: string)=> {
switch(coin || selectedCoin){
case "LITECOIN":{
@ -285,7 +285,7 @@ function App() {
default:
return null
}
}
}, [selectedCoin])
const gameContextValue: IContextProps = {
userInfo,

View File

@ -218,7 +218,7 @@ export const TradeOffers: React.FC<any> = ({ foreignCoinBalance }: any) => {
},
},
];
}, [qortalNames]);
}, [qortalNames, getCoinLabel]);
// const onRowClicked = (event: any) => {
// 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,
},
];
}, [selectedCoin]);
}, [selectedCoin, getCoinLabel]);
useEffect(() => {
if (qortAddress) {
qortAddressRef.current = qortAddress;