Basic information
About writing-react-effects
Writes React components without unnecessary useEffect. Use when creating/reviewing React components, refactoring effects, or when code uses useEffect to transform data or handle events.
writing-react-effects is an agent skill listed in the AddMCP.net directory, published by dust-tt. Source code is hosted on github.com.
Overview
What is writing-react-effects?
name: writing-react-effects description: Writes React components without unnecessary useEffect. Use when creating/reviewing React components, refactoring effects, or when code uses useEffect to transform data or handle events.
Writing React Effects Skill
Guides writing React components that avoid unnecessary useEffect calls.
Core Principle
Effects are an escape hatch for synchronizing with external systems (network, DOM, third-party widgets). If there's no external system, you don't need an Effect.
Calculate Derived State During Rendering
{fullName}
} ``` **Correct (derive during render):** ```tsx function Form() { const [firstName, setFirstName] = useState('First') const [lastName, setLastName] = useState('Last') const fullName = firstName + ' ' + lastName return{fullName}
} ``` References: [You Might Not Need an Effect](https://react.dev/learn/you-might-not-need-an-effect)
Comments
No comments yet
Be the first to share feedback about this listing. Sign in to leave a comment.
Sign In