react-use-effect

react-use-effect is a skill for Claude Code from ncaq/konoka. It costs 40 tokens per session (922 once invoked), scanned A, original, Apache-2.0.

A set of rules for deciding when React's useEffect should connect a component to outside systems such as browser features, networks, or third-party libraries. React is a JavaScript library for building user interfaces, and useEffect runs code in response to rendered state changes.

In plain words
What is it for?
Use it when writing or reviewing React components that contain useEffect or might need one, including data calculations, event handling, state resets, and cached calculations.
Why use it?
It helps avoid using effects for calculations, button actions, or state resets that React can handle more directly.

Skill for Claude Code

Written for Claude Code: user-invocable in frontmatter.

Part of the web-tasuke plugin — 17 skills shipped together

Good fit Use it when writing or reviewing React components that contain useEffect or might need one, including data calculations, event handling, state resets, and cached calculations.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/ncaq/konoka/react-use-effect
View source ↗ ncaq/konoka
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add ncaq/konoka --skill react-use-effect
Clone the repo
git clone --depth 1 https://github.com/ncaq/konoka

Made for: Claude Code.

Or install web-tasuke, the plugin that ships this one along with the rest of its 17 skills.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for react-use-effect

README.md
[![agentmods](https://agentmods.dev/badge/skills/ncaq/konoka/react-use-effect/github.svg)](https://agentmods.dev/skills/ncaq/konoka/react-use-effect)
Your own site
<a href="https://agentmods.dev/skills/ncaq/konoka/react-use-effect"><img src="https://agentmods.dev/badge/skills/ncaq/konoka/react-use-effect/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for react-use-effect

Your own site · 80×15
<a href="https://agentmods.dev/skills/ncaq/konoka/react-use-effect"><img src="https://agentmods.dev/badge/skills/ncaq/konoka/react-use-effect.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 40 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 922 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00040 $0.00922
Opus 5 $0.00020 $0.00461
Sonnet 5 $0.00008 $0.00184
Haiku 4.5 $0.00004 $0.00092

Measured 4d ago against content hash 15adf08536ae, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-09, from the pricing page.

Security

Grade A, and why

react-use-effect scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 4d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

plugins/web-tasuke/skills/react-use-effect/SKILL.md · 107 lines

How it starts

The opening of the file, as written. The whole thing — 107 lines — stays where its author put it; the contents beside it link to each section on GitHub.

useEffectの使いどころを見極める

useEffectは外部システム(ブラウザAPI、ネットワーク、サードパーティライブラリ)との同期にのみ使います。 それ以外の用途では、より適切な代替手段がないか検討してください。

参考: You Might Not Need an Effect

useEffectを使わずに解決するパターン

レンダリング用のデータ変換は直接計算します

// Bad: useEffectでstateを更新
const [fullName, setFullName] = useState("");
useEffect(() => {
  setFullName(firstName + " " + lastName);
}, [firstName, lastName]);

// Good: レンダリング中に計算
const fullName = firstName + " " + lastName;

ユーザー操作の処理はイベントハンドラで行います

// Bad: useEffectで副作用を検知
useEffect(() => {
  if (product.isInCart) {
    showNotification(`Added ${product.name} to cart!`);
  }
}, [product]);

// Good: イベントハンドラで直接処理
function handleBuyClick() {
  addToCart(product);
  showNotification(`Added ${product.name} to cart!`);
}

propsが変わったときの状態リセットにはkeyを使います

// Bad: useEffectでリセット
useEffect(() => {
  setComment("");
}, [userId]);

// Good: keyでコンポーネントを再マウント
<Profile userId={userId} key={userId} />;

高コストな計算のキャッシュにはuseMemoを使います

// Bad: useEffectで計算結果をstateに保存
useEffect(() => {
  setFilteredTodos(getFilteredTodos(todos, filter));
}, [todos, filter]);

// Good: useMemoでキャッシュ
const filteredTodos = useMemo(() => getFilteredTodos(todos, filter), [todos, filter]);

データ取得にはデータフェッチライブラリを使います

// Bad: useEffectで手動フェッチ(冗長なボイラープレート、キャッシュなし、重複排除なし)
useEffect(() => {
  let ignore = false;
  fetchData(id).then((data) => {
    if (!ignore) setData(data);
  });
  return () => {
    ignore = true;
  };
}, [id]);

// Good: TanStack Query等を使う
const result = useSuspenseQuery({ queryKey: ["data", id], queryFn: () => fetchData(id) });

useEffectが適切なケース

  • ブラウザAPIとの同期(IntersectionObserverResizeObserverなど)
  • サードパーティライブラリの初期化・破棄
  • 外部接続の管理(WebSocketなど)

これらの場合でも、 より高抽象度なhooksやライブラリが使えないか検討してください。

useEffectを使う場合はカスタムフックに切り出す

コンポーネント本体にuseEffectを直接書くことは禁止です。 必ずカスタムフックに切り出し、コンポーネント側はそのフックを呼ぶだけにしてください。

カスタムフックには責務を表す名前をつけます。 useDocumentTitle, useWindowResize, useDeviceListSubscriptionなど。 フックの配置場所はプロジェクトの規約に従ってください。 典型的にはsrc/hooks/のような共有ディレクトリか、 そのコンポーネントに固有のものであれば同じディレクトリの別ファイルに置きます。

Read the full file on GitHub · 107 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 4d ago First seen · 107 lines · 40 tokens per session scan A 15adf08536ae

Subscribe to this mod's changes

react-use-effect is a skill published in the GitHub repository ncaq/konoka (3 stars, last pushed yesterday), licensed Apache-2.0. It adds 40 tokens to every session and 922 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-05.

Related

Other skills, from other repositories