alejandrobailoalejandrobailoCommunityยท1 Agent Skills Included

no-use-effect

Enforces clean React code without direct useEffect hooks

Enforces a strict no-direct-useEffect rule across React and React Native components. Replaces fragile effects with derived state, event handlers, data-fetching libraries, key-based resets, and useMountEffect. Eliminates race conditions, infinite loops, and stale-state bugs caused by misused effects. Guides code reviews, refactoring, and new component writing with a clear decision checklist.
npx skills add alejandrobailo/no-use-effect --all -g -y

All Skills in This Repository (1)

Pure Emerald Level Indicators

Frequently Asked Questions

FAQPage Schema
How to install no-use-effect?โ–ผ

Run `npx skills add alejandrobailo/no-use-effect --all -g -y` in your terminal to install it globally.

Why avoid useEffect in React components?โ–ผ

Direct useEffect calls often cause race conditions, extra renders, and stale-state bugs. This skill replaces them with derived state, event handlers, and data-fetching libraries that are easier to debug.

What should I use instead of useEffect for data fetching?โ–ผ

Use a data-fetching library like React Query or SWR, which handles caching, cancellation, and retries automatically. In React 19+, you can also use the use() hook with Suspense.

Does no-use-effect work with React Native?โ–ผ

Yes. The rules apply to both React and React Native codebases, covering new components, edits, reviews, and refactoring.

When is useEffect still allowed?โ–ผ

Only inside reusable custom hooks like useMountEffect for true mount-time sync with external systems. Components themselves must never call useEffect directly.

Related Repositories in Software Engineering

View All in Software Engineeringโ†’