rerender-functional-setstate
✓機能的な setState 更新を使用して、古いクロージャや不要なコールバックの再作成を防ぎます。 React コンポーネントの現在の状態値に基づいて状態を更新するときに適用します。
SKILL.md
When updating state based on the current state value, use the functional update form of setState instead of directly referencing the state variable. This prevents stale closures, eliminates unnecessary dependencies, and creates stable callback references.
The first callback is recreated every time items changes, which can cause child components to re-render unnecessarily. The second callback has a stale closure bug—it will always reference the initial items value.
Note: If your project has React Compiler enabled, the compiler can automatically optimize some cases, but functional updates are still recommended for correctness and to prevent stale closure bugs.
機能的な setState 更新を使用して、古いクロージャや不要なコールバックの再作成を防ぎます。 React コンポーネントの現在の状態値に基づいて状態を更新するときに適用します。 ソース: theorcdev/8bitcn-ui。
引用可能な情報
AI/検索での引用用の安定したフィールドとコマンド。
- インストールコマンド
npx skills add https://github.com/theorcdev/8bitcn-ui --skill rerender-functional-setstate- カテゴリ
- *クリエイティブ
- 認証済み
- ✓
- 初回登録
- 2026-02-01
- 更新日
- 2026-02-18
クイックアンサー
rerender-functional-setstate とは?
機能的な setState 更新を使用して、古いクロージャや不要なコールバックの再作成を防ぎます。 React コンポーネントの現在の状態値に基づいて状態を更新するときに適用します。 ソース: theorcdev/8bitcn-ui。
rerender-functional-setstate のインストール方法は?
ターミナルまたはコマンドラインツール(Terminal、iTerm、Windows Terminal など)を開きます このコマンドをコピーして実行します: npx skills add https://github.com/theorcdev/8bitcn-ui --skill rerender-functional-setstate インストール後、スキルは自動的に AI コーディング環境に設定され、Claude Code や Cursor で使用できるようになります
ソースリポジトリはどこですか?
https://github.com/theorcdev/8bitcn-ui
詳細
- カテゴリ
- *クリエイティブ
- ソース
- skills.sh
- 初回登録
- 2026-02-01