perf: memoize derived values and stabilize callbacks in Landing and R… - #571
perf: memoize derived values and stabilize callbacks in Landing and R…#571LockedTerminal wants to merge 1 commit into
Conversation
…egistryTable - Landing: move STEPS to module-level const; wrap intensity computation and verify-rows array in useMemo so they are only recomputed when pool data or the translation function changes - RegistryTable: wrap toggleSort, handleEdit, handleCancel, handleSave in useCallback; hoist all translated labels into a single useMemo block; wrap Th and Row sub-components in React.memo so sort-triggered parent re-renders do not cascade to unchanged rows/headers - Row now accepts onEdit(id) / onSave(id, credit, green) signatures so the parent can pass stable handlers without per-row closures; open() and handleSave inside Row are stabilised with useCallback Closes Heliobond#388
|
@LockedTerminal is attempting to deploy a commit to the David Dada's projects Team on Vercel. A member of the Team first needs to authorize it. |
sshdopey
left a comment
There was a problem hiding this comment.
Great work on this performance pass! Moving STEPS to a module constant and memoizing the intensity and verify rows in Landing are solid wins. In RegistryTable, wrapping handlers in useCallback and memoizing Th and Row should cut down on needless re-renders nicely. The refactor to pass row ids to stable callbacks is a clean pattern. Thanks for tackling #388 — this looks like a thoughtful, well-scoped improvement. Keep it up! ❤️
|
Approved! 🎉 I couldn't auto-merge this just yet (it may need a rebase or have a check still running). A maintainer can merge it whenever it's ready. |
…egistryTable
Closes #388
Summary
Linked issue
Closes #
Type of change
Screenshots / screencast
Checklist
Closes #…)bun run buildpasses locally (builds + type-checks)messages/en.jsonandmessages/fr.json(if any copy changed)closes #388