react-effect-decision

Provides a decision framework for React components to minimize useEffect usage via render-time derivations.

3|Updated May 23, 2026
One-click install
npx skills add https://github.com/waynesutton/finder9 --skill react-effect-decision
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: react-effect-decision
Source: https://github.com/waynesutton/finder9/tree/main/.codex/skills/react-effect-decision
Command: npx skills add https://github.com/waynesutton/finder9 --skill react-effect-decision

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Combines React's official guidance from You Might Not Need an Effect with this project's stricter no direct useEffect stance to help developers avoid unnecessary effects and keep derived state in render, reducing unintentional side effects.

Core Features & Use Cases

  • Provides a decision framework to minimize direct useEffect usage by deriving values in render, using event handlers, and leveraging key-based remounts.
  • Offers patterns like a dedicated useMountEffect wrapper for one-time setups, and guidance for subscriptions, external data, and client fetching without sprinkling raw effects throughout feature code.
  • Suits writing, reviewing, or refactoring React components that might otherwise reach for useEffect, derived state, or external synchronization.

Quick Start

Refactor components to derive values in render and replace direct useEffect with event handlers, memoization, or a dedicated useMountEffect wrapper.

Frequently Asked Questions about react-effect-decision

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I avoid unnecessary useEffect in React components?

Avoid unnecessary useEffect by deriving values in render, using event handlers for user actions, and leveraging key-based remounts instead of sprinkling raw effects. This reduces unintentional side effects and simplifies component logic.

What is the best way to handle derived state in React without useEffect?

The best way to handle derived state without useEffect is to calculate it during the render phase. Render-time derivation eliminates the extra render cycles caused by state updates inside effects, keeping your component architecture cleaner and more predictable.

When should I use a useMountEffect wrapper instead of a direct useEffect?

Use a dedicated useMountEffect wrapper for one-time setups like initial subscriptions instead of direct useEffect. This enforces a clear policy by isolating mount-time logic, preventing raw effects from being sprinkled throughout your feature code during component refactoring.

Does this React useEffect decision framework work for refactoring existing components?

Yes, this useEffect decision framework works for refactoring existing React components. It provides actionable rules to identify and replace state, effect, subscription, and event handling patterns with safer alternatives like render-time derivations and memoization.

How to fetch external data in React without sprinkling raw useEffect?

Fetch external data by moving logic out of raw useEffect into event handlers or dedicated fetching patterns. The framework guides you to handle client fetching and subscriptions safely, minimizing side effects and keeping feature code clean during component design.

Why does deriving state in render reduce side effects compared to useEffect?

Deriving state in render reduces side effects because it calculates values synchronously without triggering additional render cycles. Unlike useEffect, which updates state post-render and causes re-renders, render-time derivation keeps component behavior predictable and effect-free.