const futures24hUnSubscribe = useCallback((symbols: Array<string>) => {
  if (null === futures24hWs || futures24hReadyState !== ReadyState.OPEN) return;
  const symbolsTicker = symbols.map(symbol => `${symbol.toLowerCase()}@miniTicker`);

  futures24hWs.send(JSON.stringify({
    id: ((new Date()).getTime() + Math.floor(Math.random() * 10000) + 10000).toFixed(0),
    method: "UNSUBSCRIBE",
    params: symbolsTicker,
  }));
}, [futures24hReadyState]);

у нас есть функция futures24hUnSubscribe 

import {BinanceWsProviderProps} from “./BinanceWsProvider.props”;
import {ReadyState, useBinancePrice} from “…/…/hooks/binancePrices”;
import {createContext, useContext, useEffect, useState} from “react”;

interface BinanceWsProviderContext {

futures24hSubscribe: (symbol: string) => void;
futures24hUnSubscribe: (symbol: string) => void;
futures24hReadyState: number;

}

const defaultContextValue: BinanceWsProviderContext = {

futures24hSubscribe: (symbol: string) => {},
futures24hUnSubscribe: (symbol: string) => {},
futures24hReadyState: 0,

};

const Context = createContext(defaultContextValue);

export function useBinanceWsProvider() {
return useContext(Context);
}

const [futures24hSymbols, setFutures24hSymbols] = useState<Array<string>>([]);
const [futures24hQueue, setFutures24hQueue] = useState<Array<string>>([]);

futures24hSubscribe,
// futures24hUnSubscribe,
futures24hReadyState,

const futures24hSymbolSubscribe = (symbol: string) => {
if (futures24hSymbols.includes(symbol) || futures24hQueue.includes(symbol)) return;

setFutures24hQueue(prev => […prev, symbol]);
};

const futures24hSymbolUnsubscribe = (symbol: string) => {
if (!futures24hSymbols.includes(symbol) && !futures24hQueue.includes(symbol)) return;

setFutures24hQueue(prev => prev.filter(item => item !== symbol));
};

const subscribeFromFutures24hQueue = () => {
futures24hSubscribe(futures24hQueue);
setFutures24hSymbols([…futures24hSymbols, …futures24hQueue]);
setFutures24hQueue([]);
};

useEffect(() => {
if (futures24hQueue.length > 0 && futures24hReadyState === ReadyState.OPEN) {
subscribeFromFutures24hQueue();
}
}, [futures24hQueue]);

useEffect(() => {
if (futures24hReadyState === ReadyState.CLOSED) {
setFutures24hQueue([…futures24hSymbols, …futures24hQueue]);
setFutures24hSymbols([]);
}

if (futures24hQueue.length > 0 && futures24hReadyState === ReadyState.OPEN) {
subscribeFromFutures24hQueue();
}
}, [futures24hReadyState]);

return <Context.Provider
value={{

futures24hSubscribe: futures24hSymbolSubscribe,
futures24hUnSubscribe: futures24hSymbolUnsubscribe,
futures24hReadyState: futures24hReadyState,

}}
>
{children}
</Context.Provider>;
};

export default BinanceWsProvider;

есть компонент BinanceWsProvider


export const Component = () => {
  <Box className="scroll-block" sx={{overflowY: "scroll", overflowX: "hidden", height: 640}}>
              {symbols.map((symbol) => (
                <Symbols
                  key={symbol}
                  symbol={symbol}
                  activeSymbol={activeSymbol}
                  setActiveSymbol={setActiveSymbol}
                />
              ))}
            </Box>
}
type SymbolsProps = {
    symbol: string
    activeSymbol: string
    setActiveSymbol: (symbol: string) => void
}

const Symbols = ({symbol, activeSymbol, setActiveSymbol}:SymbolsProps) => {
  const {futures24hSubscribe, futures24hUnSubscribe} = useBinanceWsProvider();
  
  useEffect(() => { 
    futures24hSubscribe(symbol);

    return () => futures24hUnSubscribe(symbol);
  }, [symbol]);
 return <Grid item xs={5.5} display="flex" justifyContent="space-between">
        <Typography fontSize={13} color={activeSymbol === symbol ? "#fff" : ""} fontWeight={300}>${FormatPrice({amount: coin.price, currency_iso_code: "USD", dec: "decimal"})}</Typography>
        <Typography fontSize={13} color={activeSymbol === symbol ? "#fff" : coin.percent >= 0 ? "#006943" : "#B41C18"} fontWeight={300}>
          {coin.percent >= 0 ? `+${coin.percent}` : coin.percent}%
        </Typography>
      </Grid>
};

и есть компонент где вызывается futures24hUnSubscribe ..


проанализируй код..

Нужно в компоненте BinanceWsProvider const {
    futures24hSubscribe,
    futures24hUnSubscribe,
    futures24hReadyState,
  } = useBinancePrice();   // futures24hUnSubscribe нигде не исполльзуется, нужно, чтобы когда вызывался    useEffect(() => { 
    return () => futures24hUnSubscribe(symbol);
  }, []); демонтировании, то  в  BinanceWsProvider  организовать такую логику, чтобы futures24hUnSubscribe принимал массив символов, например как futures24hSubscribe(futures24hQueue);, и происходила отписка метод UNSUBSCRIBE