pancake-frontend icon indicating copy to clipboard operation
pancake-frontend copied to clipboard

perf: Use callback on aptos query select

Open memoyil opened this issue 4 months ago • 2 comments


PR-Codex overview

This PR primarily focuses on optimizing the selection functions across various components by replacing inline functions with useCallback. This change enhances performance by memoizing the functions, preventing unnecessary re-renders.

Detailed summary

  • Replaced inline select functions with useCallback in:
    • apps/aptos/components/SearchModal/CurrencyList.tsx
    • apps/aptos/components/Farms/components/FarmCard/ApyButton.tsx
    • apps/aptos/components/Farms/components/FarmTable/Actions/StakedAction.tsx
    • apps/aptos/components/Pools/hooks/usePoolsList.ts
    • apps/aptos/components/Liquidity/hooks/useLPPairsHaveBalance.ts
    • apps/aptos/views/Ifos/hooks/useIfoUserInfo.ts
    • apps/aptos/hooks/Tokens.ts
    • apps/aptos/views/Ifos/hooks/useIfoResources.ts

✨ Ask PR-Codex anything about this PR by commenting with /codex {your question}

memoyil avatar Oct 13 '24 10:10 memoyil