pancake-frontend
pancake-frontend copied to clipboard
perf: Use callback on aptos query select
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 withuseCallback
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}