Optimize Hooks and Component Performance#44
Open
azrim wants to merge 9 commits intohelios-network:mainfrom
Open
Optimize Hooks and Component Performance#44azrim wants to merge 9 commits intohelios-network:mainfrom
azrim wants to merge 9 commits intohelios-network:mainfrom
Conversation
Memoizes the blockTime calculation to prevent unnecessary re-computations on every render. This improves performance by only recalculating the value when the block data changes.
Wrapped the handleEscKey event handler in useCallback to prevent it from being recreated on every render of the Modal component.
Moves useCallback for handleEscKey to the top level of the component to fix an "Invalid hook call" error. Also wraps the handleClose function in useCallback to ensure it has a stable reference, preventing the useEffect hook from re-running unnecessarily. This improves the performance and stability of the component.
|
@azrim is attempting to deploy a commit to the GraphLinq Team on Vercel. A member of the Team first needs to authorize it. |
* Implements code splitting for the Stake and Unstake modals to improve initial page load performance. * Fixes critical TypeScript errors by correcting prop types in the Row component. * Aligns the component with the ValidatorRow data structure, resolving UI bugs.
Users reported that the asset selector was sometimes unclickable in the stake and unstake modals. This was happening because the asset list was still being fetched when the modal opened. This commit now shows a "Loading..." message to the user, letting them know the data is on its way and preventing interaction with the empty dropdown.
Optimizes the claim modal by using the isLoading state from the useRewards hook, removing redundant local state. Also improves user feedback by using toast.promise for clearer loading and success messages.
…ance prevent components and functions from being recreated on every render unless their dependencies have changed, leading to a more efficient and responsive UI
optimizes the dashboard by memoizing the Stat component and its props to prevent unnecessary re-renders.
improves the performance of the validator detail page by memoizing its child components to prevent unnecessary re-renders.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request introduces several key optimizations and fixes to improve application performance and user experience.