aafre/resume-builder
GitHub で見るperf(editor): Extract memoized list item components to prevent callback recreation
Open
#204 opened on 2026年1月18日
enhancementgood first issueperformance
Repository metrics
- Stars
- (6 stars)
- PR merge metrics
- (PR metrics pending)
説明
Summary
Extract list items into memoized sub-components with useCallback handlers to prevent unnecessary re-renders from inline callback creation.
Background
Identified in PR #196 review: https://github.com/aafre/resume-builder/pull/196#discussion_r2674280330
Inline callbacks in .map() loops create new function instances on every render, causing child components to re-render unnecessarily.
Affected Files
ExperienceSection.tsx- Lines 131, 187, 198, 210, 230, 259 (most critical - nested loops)EducationSection.tsx- Lines 165, 185, 199, 210, 223, 234GenericSection.tsx- Lines 130, 149, 155, 190, 209, 215, 250, 269, 275IconListSection.tsx- Lines 144, 165, 181, 194, 205, 213ContactInfoSection.tsx- Lines 152, 176, 206, 229
Approach
-
Create memoized sub-components:
DescriptionItemfor experience descriptionsExperienceEntryfor experience cardsEducationEntryfor education cardsListItemvariants for GenericSectionCertificationItemfor IconListSectionSocialLinkItemfor ContactInfoSection
-
Use
React.memo()wrapper on sub-components -
Use
useCallbackfor handlers inside sub-components -
Pass stable callbacks from parent (memoized with
useCallback)
Example Pattern
// Before
{items.map((item, index) => (
<RichTextInput onChange={(value) => handleUpdate(index, value)} />
))}
// After
const MemoizedItem = React.memo(({ index, onUpdate }) => {
const handleChange = useCallback((value) => onUpdate(index, value), [index, onUpdate]);
return <RichTextInput onChange={handleChange} />;
});
Priority
Medium - Performance optimization. Most impactful for resumes with many experience entries and description points.