Skip to content

feat: react doctor for remove useMemo and useCallback - #5748

Open
cuzz-venus wants to merge 3 commits into
mainfrom
refactor/react-doctor
Open

feat: react doctor for remove useMemo and useCallback#5748
cuzz-venus wants to merge 3 commits into
mainfrom
refactor/react-doctor

Conversation

@cuzz-venus

@cuzz-venus cuzz-venus commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

Jira ticket(s)

VPD-1691

Changes

  • refactor

@changeset-bot

changeset-bot Bot commented Jul 29, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: bc430d3

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@vercel

vercel Bot commented Jul 29, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
dapp-preview Ready Ready Preview Jul 30, 2026 9:37am
dapp-testnet Ready Ready Preview Jul 30, 2026 9:37am
venus.io Ready Ready Preview Jul 30, 2026 9:37am

Request Review

@greptile-apps

greptile-apps Bot commented Jul 29, 2026

Copy link
Copy Markdown

Greptile Summary

Refactors React components and hooks to calculate derived values directly during rendering instead of wrapping them in useMemo or useCallback.

  • Removes redundant memoization from display values, table configurations, form limits, reward groups, and query-derived data.
  • Preserves the existing formulas, transaction paths, API contracts, and rendered behavior.

Confidence Score: 5/5

The PR appears safe to merge because the removed memoization does not alter reachable behavior, state ownership, transaction logic, or external contracts.

Table sorting remains controlled or mount-initialized, form schemas continue receiving equivalent numeric limits, and query keys normalize derived arrays by content rather than reference identity.

Important Files Changed

Filename Overview
apps/evm/src/hooks/useGetSwapInfo/useGetTokenCombinations.ts Removes memoization from the base-token filter while preserving token combinations and normalized PancakeSwap query keys.
apps/evm/src/containers/Layout/NavBar/ClaimRewardsButton/useGetGroups.ts Computes internal and external reward groups directly during rendering without changing their contents or claim construction.
apps/evm/src/pages/Vai/Borrow/useForm/index.ts Computes converted VAI limits directly while preserving schema validation and React Hook Form behavior.
apps/evm/src/pages/Vai/Repay/useForm/index.ts Removes memoization from wallet-balance conversion without changing repayment limits or validation.
apps/evm/src/pages/PrimeLeaderboard/RewardTable/index.tsx Recreates reward-token columns during rendering while retaining controlled sorting and stable row reconciliation.
apps/evm/src/components/Table/TableCards/index.tsx Derives sorting options directly without affecting table ordering state or selection behavior.

Reviews (1): Last reviewed commit: "feat: remove usememo" | Re-trigger Greptile

@github-actions

github-actions Bot commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

Coverage Report for ./apps/evm

Status Category Percentage Covered / Total
🔵 Lines 77.78% 49872 / 64118
🔵 Statements 77.78% 49872 / 64118
🔵 Functions 72.74% 1543 / 2121
🔵 Branches 85.05% 7237 / 8509
File Coverage
File Stmts Branches Functions Lines Uncovered Lines
Changed Files
apps/evm/src/clients/api/queries/useGetAsset/index.tsx 100% 100% 100% 100%
apps/evm/src/clients/api/queries/useGetAsset/findAssetByVTokenAddress/index.ts 89.47% 83.33% 100% 89.47% 13-14
apps/evm/src/clients/api/queries/useGetPool/index.tsx 100% 100% 100% 100%
apps/evm/src/clients/api/queries/useGetVaults/index.ts 100% 100% 100% 100%
apps/evm/src/components/AccountHealthBar/index.tsx 95.2% 63.15% 100% 95.2% 49, 65, 73, 130, 138-139, 184
apps/evm/src/components/ActiveVotingProgress/index.tsx 97.95% 23.07% 100% 97.95% 101-102
apps/evm/src/components/Chip/index.tsx 60% 50% 16.66% 60% 29, 37-51
apps/evm/src/components/MarkdownEditor/index.tsx 100% 66.66% 100% 100%
apps/evm/src/components/ProgressCircle/index.tsx 100% 75% 100% 100%
apps/evm/src/components/Select/index.tsx 97.72% 80.76% 60% 97.72% 77-79
apps/evm/src/components/Table/TableCards/index.tsx 90.82% 100% 33.33% 90.82% 56-66
apps/evm/src/components/TokenTextField/index.tsx 100% 100% 100% 100%
apps/evm/src/containers/ChainExplorerLink/index.tsx 88.23% 50% 100% 88.23% 35-37, 43
apps/evm/src/containers/Layout/Header/Breadcrumbs/index.tsx 0% 0% 0% 0% 1-38
apps/evm/src/containers/Layout/NavBar/ClaimRewardsButton/index.tsx 95.28% 86.36% 100% 95.28% 38-39, 65-67
apps/evm/src/containers/Layout/NavBar/ClaimRewardsButton/useGetGroups.ts 98.72% 94.11% 100% 98.72% 116-117
apps/evm/src/containers/MarketForm/BoostForm/SubmitSection/index.tsx 100% 88.88% 50% 100%
apps/evm/src/containers/MarketForm/Repay/RepayWithCollateralForm/SubmitSection/index.tsx 100% 88.88% 50% 100%
apps/evm/src/containers/MarketForm/WithdrawForm/index.tsx 91.73% 90.56% 80% 91.73% 80-84, 183-199, 221-222, 407-411
apps/evm/src/containers/MarketForm/WithdrawForm/SubmitSection/index.tsx 100% 100% 100% 100%
apps/evm/src/containers/TopMarkets/index.tsx 93.33% 82.6% 50% 93.33% 39-45, 147
apps/evm/src/containers/VaultCard/PendleVaultModal/OverviewTab/TotalDeposits/index.tsx 11.11% 100% 0% 11.11% 13-69
apps/evm/src/hooks/useGetSwapInfo/useGetTokenCombinations.ts 96.29% 85% 100% 96.29% 34, 38-39
apps/evm/src/hooks/useIsProposalExecutable/index.tsx 100% 100% 100% 100%
apps/evm/src/hooks/useNavigate/index.ts 100% 100% 100% 100%
apps/evm/src/hooks/useSendTransaction/useTrackTransaction/index.tsx 95.09% 75.86% 100% 95.09% 53, 55-56, 96, 122
apps/evm/src/hooks/useUrlPagination/index.ts 100% 100% 100% 100%
apps/evm/src/pages/Dashboard/Markets/Positions/Tables/index.tsx 55.39% 71.42% 100% 55.39% 84-87, 99-166
apps/evm/src/pages/Dashboard/Transactions/index.tsx 82.84% 69.69% 12.5% 82.84% 50-55, 58-63, 66-69, 74-81, 88-96, 194-199
apps/evm/src/pages/Governance/ProposalList/CreateProposalModal/ProposalWizard/index.tsx 87.69% 93.33% 87.5% 87.69% 63-76, 85, 110
apps/evm/src/pages/Governance/ProposalList/GovernanceProposal/index.tsx 97.72% 85.71% 100% 97.72% 73, 77, 118
apps/evm/src/pages/Governance/ProposalList/GovernanceProposal/Status/Indicator/index.tsx 91.66% 85.71% 100% 91.66% 24-26
apps/evm/src/pages/Governance/ProposalList/GovernanceProposal/getVoteStatusLabel/index.ts 76.92% 25% 100% 76.92% 12, 14, 16
apps/evm/src/pages/Governance/VotingWallet/index.tsx 97.75% 89.28% 28.57% 97.75% 45-47, 153
apps/evm/src/pages/Market/MarketInfo/index.tsx 88.73% 50% 100% 88.73% 43-44, 62-63, 98-107, 133, 155
apps/evm/src/pages/PrimeLeaderboard/LastCycleSummaryModal/useGetPrimeLastCycleSummary/index.ts 95.45% 85.71% 100% 95.45% 33-34
apps/evm/src/pages/PrimeLeaderboard/RankTable/index.tsx 95.14% 64.28% 80% 95.14% 40, 87, 117-119
apps/evm/src/pages/PrimeLeaderboard/RewardTable/index.tsx 90.43% 78.94% 83.33% 90.43% 73, 110, 122-130
apps/evm/src/pages/PrimeLeaderboard/useGetPrimeTotalRewards/index.ts 96.77% 90.9% 100% 96.77% 30
apps/evm/src/pages/PrimeLeaderboard/useGetPrimeUserRewards/index.ts 78.57% 66.66% 100% 78.57% 33-34, 37, 45-51
apps/evm/src/pages/Proposal/Commands/index.tsx 100% 100% 100% 100%
apps/evm/src/pages/Proposal/Commands/BscCommand/CurrentStep/index.tsx 69.86% 78.94% 100% 69.86% 22-27, 30-35, 38-43, 59-62
apps/evm/src/pages/Proposal/Commands/BscCommand/CurrentStep/getPreviousStepDate/index.ts 91.66% 91.66% 100% 91.66% 5-6
apps/evm/src/pages/Proposal/Commands/NonBscCommand/CurrentStep/index.tsx 73.68% 72.22% 100% 73.68% 28-32, 40-44, 52-56, 63-67, 75-79
apps/evm/src/pages/Proposal/Commands/NonBscCommand/CurrentStep/getPreviousStepDate/index.ts 100% 100% 100% 100%
apps/evm/src/pages/Proposal/Commands/Status/index.tsx 92.68% 87.5% 100% 92.68% 43-45
apps/evm/src/pages/Swap/index.tsx 98.01% 85.45% 100% 98.01% 165-166, 412-416
apps/evm/src/pages/Swap/SubmitSection/index.tsx 100% 100% 100% 100%
apps/evm/src/pages/Swap/SwapDetails/index.tsx 95.55% 90% 100% 95.55% 61-62, 71-72
apps/evm/src/pages/Trade/Positions/PositionList/index.tsx 100% 100% 100% 100%
apps/evm/src/pages/Vai/Borrow/index.tsx 96.29% 88.88% 100% 96.29% 158-163, 178-179
apps/evm/src/pages/Vai/Borrow/getLimitTokens/index.ts 88.88% 71.42% 100% 88.88% 31-32, 41-42
apps/evm/src/pages/Vai/Borrow/useForm/index.ts 100% 100% 100% 100%
apps/evm/src/pages/Vai/Repay/useForm/index.ts 97.36% 87.5% 100% 97.36% 34-35
apps/evm/src/pages/Voter/Transactions/index.tsx 57.01% 50% 20% 57.01% 38-69, 76-84, 93-97, 108-114
apps/evm/src/pages/VoterLeaderboard/LeaderboardTable/index.tsx 100% 100% 100% 100%
Generated in workflow #13984 for commit bc430d3 by the Vitest Coverage Report Action

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants