home / skills / harborgrid-justin / lexiflow-premium / precision-re-render-control
/frontend/.github-skills/precision-re-render-control
This skill helps you minimize unnecessary re-renders by partitioning state and using selector-driven updates to optimize React applications.
npx playbooks add skill harborgrid-justin/lexiflow-premium --skill precision-re-render-controlReview the files below or copy the command above to add this skill to your agents.
---
name: precision-re-render-control
description: Minimize unnecessary re-renders through precise state partitioning and selector-driven updates.
---
# Precision Re-render Control (React 18)
## Summary
Minimize unnecessary re-renders through precise state partitioning and selector-driven updates.
## Key Capabilities
- Implement selector-based memoization for fine-grained updates.
- Partition global state to isolate hot paths.
- Detect referential instability and eliminate it.
## PhD-Level Challenges
- Construct a formal model of re-render propagation.
- Prove minimality of renders under defined constraints.
- Evaluate selector stability with adversarial updates.
## Acceptance Criteria
- Provide render-count baselines and improvements.
- Demonstrate stable selectors with no thrashing.
- Document state partition strategy.
This skill minimizes unnecessary React re-renders by combining precise state partitioning with selector-driven updates. It targets hot paths in UI and enforces stable selectors and referential integrity to reduce update noise. The approach yields measurable render-count improvements and clear documentation of the partition strategy.
The skill inspects component update patterns and divides global state into fine-grained partitions so only relevant subscribers re-evaluate. It layers selector-based memoization on top of partitions to compute and subscribe to exactly the derived values a component needs. It also detects referential instability (unstable object/array/function identities) and recommends transformations to eliminate thrashing.
How much improvement can I expect?
Typical improvements range from 30% to 90% fewer renders on hot paths, depending on current coupling and selector quality; always measure with baselines.
Does this require a specific state library?
No. The approach is library-agnostic: apply partitioning and selector stability principles to Redux, Zustand, Context, or custom stores.