Open memoyil opened 6 days ago
Latest commit: 1ef39867b2c13409f827ea8f193add6fcee1a5b7
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.
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
The latest updates on your projects. Learn more about Vercel for Git ↗︎
Name | Status | Preview | Comments | Updated (UTC) |
---|---|---|---|---|
aptos-web | ✅ Ready (Inspect) | Visit Preview | 💬 Add feedback | Nov 25, 2024 8:15am |
blog | ✅ Ready (Inspect) | Visit Preview | 💬 Add feedback | Nov 25, 2024 8:15am |
bridge | ✅ Ready (Inspect) | Visit Preview | 💬 Add feedback | Nov 25, 2024 8:15am |
games | ✅ Ready (Inspect) | Visit Preview | 💬 Add feedback | Nov 25, 2024 8:15am |
gamification | ✅ Ready (Inspect) | Visit Preview | 💬 Add feedback | Nov 25, 2024 8:15am |
uikit | ✅ Ready (Inspect) | Visit Preview | 💬 Add feedback | Nov 25, 2024 8:15am |
web | ✅ Ready (Inspect) | Visit Preview | 💬 Add feedback | Nov 25, 2024 8:15am |
To reproduce:
Go to v3 increase liquidity Click increase after selecting token amounts See increase button not working
Root cause:
Deadline variable at the time modal rendered not yet available therefore it causes onIncrease return without calling the tx. Even the deadline variable (which needs blocktimestamp rpc call to return) ready after some seconds modal cannot be updated due to functional props stringify is as same as old one.
PR-Codex overview
This PR focuses on optimizing several components by using
useCallback
to memoize functions, which helps prevent unnecessary re-renders in React applications. This improves performance and maintains the stability of function references.Detailed summary
handleBeforeDismiss
inAddressSearch.tsx
to useuseCallback
.RemoveLiquidityV3.tsx
to useuseCallback
.onAdd
inAddLiquidity/index.tsx
to auseCallback
function.onSuccess
inCollectWinningsButton.tsx
to useuseCallback
.onAdd
inAddStableLiquidity/index.tsx
to useuseCallback
.onRemove
inRemoveStableLiquidity/index.tsx
to auseCallback
function.onRemove
inRemoveLiquidity/index.tsx
to useuseCallback
.modalHeader
inliquidity/[tokenId].tsx
to useuseCallback
.handlePickedRewardToken
inSubmitAction/index.tsx
to useuseCallback
.handleStake
andhandleUnstake
inFarmTable/Actions/StakedAction.tsx
to useuseCallback
.handleStake
andhandleUnstake
inFarmCard/StakeAction.tsx
to useuseCallback
.splitFunctionProps
inuseModal.ts
to manage function props efficiently.