Skip to content

Optimize Hooks and Component Performance#44

Open
azrim wants to merge 9 commits intohelios-network:mainfrom
azrim:main
Open

Optimize Hooks and Component Performance#44
azrim wants to merge 9 commits intohelios-network:mainfrom
azrim:main

Conversation

@azrim
Copy link
Copy Markdown

@azrim azrim commented Jun 26, 2025

This pull request introduces several key optimizations and fixes to improve application performance and user experience.

azrim added 3 commits June 26, 2025 10:29
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.
@vercel
Copy link
Copy Markdown

vercel bot commented Jun 26, 2025

@azrim is attempting to deploy a commit to the GraphLinq Team on Vercel.

A member of the Team first needs to authorize it.

azrim added 6 commits June 26, 2025 22:06
* 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.
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.

1 participant