extract-default-non-primitive-parameter-to-constant
CommunityStabilize memoization with constant defaults
Authorihj04982
Version1.0.0
Installs0
System Documentation
What problem does it solve?
This Skill addresses a common issue in React memoization where non-primitive default parameters (like objects or functions) cause memoization to fail because new instances are created on each render.
Core Features & Use Cases
- Fixes Memoization: Ensures stable default values for optional parameters in memoized components.
- Improves Performance: Prevents unnecessary re-renders by maintaining referential equality for default props.
- Use Case: When using a memoized React component with an optional
onClickhandler, defining the default as a constantNOOPfunction prevents the component from re-rendering unnecessarily when the prop is not provided.
Quick Start
Extract the default value for the 'onClick' prop in a memoized component to a constant.
Dependency Matrix
Required Modules
None requiredComponents
Standard package💻 Claude Code Installation
Recommended: Let Claude install automatically. Simply copy and paste the text below to Claude Code.
Please help me install this Skill: Name: extract-default-non-primitive-parameter-to-constant Download link: https://github.com/ihj04982/my-cursor-settings/archive/main.zip#extract-default-non-primitive-parameter-to-constant Please download this .zip file, extract it, and install it in the .claude/skills/ directory.
Agent Skills Search Helper
Install a tiny helper to your Agent, search and equip skill from 223,000+ vetted skills library on demand.