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

perf: Use exact hook for account and chain to reduce rerenders

Open memoyil opened this issue 7 months ago • 2 comments


PR-Codex overview

This PR updates various components to use useActiveChainId instead of useAccountActiveChain for better chain ID management.

Detailed summary

  • Replaced useAccountActiveChain with useActiveChainId in multiple components
  • Updated hooks and functions to use useAccount from 'wagmi' for account management

The following files were skipped due to too many changes: apps/web/src/views/CakeStaking/hooks/useVeCakeUserInfo.ts, apps/web/src/views/Migration/components/bCake/PositionManagerTable.tsx, apps/web/src/hooks/usePermit2Requires.ts, apps/web/src/views/Home/components/Banners/BCakeMigrationBanner.tsx, apps/web/src/views/Pools/components/RevenueSharing/JoinRevenueModal/JoinButton.tsx, apps/web/src/views/LiquidStaking/hooks/useRequestWithdraw.tsx, apps/web/src/views/FixedStaking/hooks/useStakedPools.ts, apps/web/src/views/Swap/V3Swap/hooks/useWallchain.ts, apps/web/src/views/Swap/V3Swap/hooks/useConfirmModalState.ts, apps/web/src/views/LiquidStaking/components/WithdrawRequest/index.tsx

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

memoyil avatar Jul 22 '24 11:07 memoyil