Skip to main content

you-might-not-need-an-effect

Analyze and fix useEffect anti-patterns in your code

来源信息

仓库
simstudioai/sim
最近来源活动
2026年10月10日 06:17
检测到的 SKILL.md 语言
英语
星标
29,805
分支
3,849

安装方式

默认使用会先检查来源的 Prompt;你也可以切换为直接命令,或下载本地副本。

检查来源文件

决定是否安装前,请先阅读 SKILL.md,以及 SkillsMP 当前展示的配套文件。

正在显示 SKILL.md

SKILL.md
来源说明 · 只读预览
name
you-might-not-need-an-effect
description
Analyze and fix useEffect anti-patterns in your code
argument-hint
[scope] [fix=true|false]
# You Might Not Need an Effect Arguments: - scope: what to analyze (default: your current changes). Examples: "diff to staging", "PR #123", "src/components/", "whole codebase" - fix: whether to apply fixes (default: true). Set to false to only propose changes. User arguments: $ARGUMENTS Steps: 1. Read https://react.dev/learn/you-might-not-need-an-effect to understand the guidelines 2. Analyze the specified scope for useEffect anti-patterns 3. If fix=true, apply the fixes. If fix=false, propose the fixes without applying. ## Query-backed forms When query data supplies the initial values for an editable form, do not copy it into draft state in an Effect. Render loading chrome in an outer component, then mount a keyed form child once data exists and initialize its state lazily from props. Key by the resource identity so every related draft, dialog, and upload state resets together when the resource changes. Keep independent queries in the outer component to preserve parallel fetching.
在 GitHub 查看