pancake-frontend
pancake-frontend copied to clipboard
perf: Use exact hook for account and chain to reduce rerenders
PR-Codex overview
This PR updates various components to use useActiveChainId
instead of useAccountActiveChain
for better chain ID management.
Detailed summary
- Replaced
useAccountActiveChain
withuseActiveChainId
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}