flpbalada/fb-skills/react-use-state
Claude Code and agent skill by flpbalada/fb-skills
- community
Checking that the SKILL.md file is still in the repository.
Use React useState for simple local component state. Use when adding UI state, inputs, counters, selected IDs, active tabs, local arrays or objects, updater functions, initializer functions, or debugging stale reads and mutation bugs. Prefer derived values, useRef, useReducer, context, or server-state libraries when state should not live in useState.
Install
npx vskill@latest install flpbalada/fb-skills/react-use-stateSKILL.md
The same SKILL.md was published earlier as flpbalada/fb-skills/react-use-state.
React useState
Goal
Use useState for simple local state that should trigger re-render. Avoid redundant state and direct mutation.
Rules
- Call hooks at top level only.
- Keep state local when possible.
- Store only values that cannot be derived during render.
- Create new objects and arrays when updating.
- Use updater functions when next state depends on previous state.
- Use initializer functions for expensive initial values.
- Do not read state immediately after setting and expect the new value.
- Do not call
setStateunconditionally during render.
Use When
- UI state:
isOpen,selectedId,activeTab. - Form state in simple forms.
- Local counters.
- Local arrays or objects with simple updates.
Prefer Another Tool
useRef: mutable value should not re-render.useReducer: multiple related values or complex transitions.- Derived value: value can be computed from props or state.
- Context or external store: state is shared broadly.
- TanStack Query or similar: server data and async cache.
Patterns
Reset State
Function Values
References
Output
- State choice.
- Simpler alternative when
useStateis wrong. - Immutable update path.
- Updater function when needed.
Security
- Security scanPassed, 100 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/react-use-state/SKILL.md
Popularity
- Repository stars
- 8
- Repository forks
- 1
- 7-day trend score
- 16
Stars and forks are for the whole GitHub repository, not this skill alone. Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/flpbalada/fb-skills/react-use-state)