no-use-effect
Skill0 starsChanged 2 months agoMITView on GitHub
Enforce the no-direct-useEffect rule in this starter. Use when writing or reviewing React code, especially screens, hooks, auth flows, and navigation wiring.
14 other projects use a version of this.
Adopted by
Most recently taken up by
- RIJUDEVx/agent-skillstheir own version, first seen Nov 16, 2026
- caidanw/skillstheir own version, first seen Nov 8, 2026
- humanlayer/humanlayertheir own version, first seen Oct 25, 2026
- umangjaipuria/claude-skillstheir own version, first seen Oct 23, 2026
- jtljrdn/no-use-effecttheir own version, first seen Oct 20, 2026
- mattiacerutti/supernovatheir own version, first seen Oct 8, 2026
Used with
Projects with it also use improve-codebase-architecture.
Other files people use alongside this one.
Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
GoogleSkillimprove-codebase-architecture
Scan a codebase for deepening opportunities, present them as a visual HTML report, then grill through whichever one you pick.
Also in 3 projects that use this
Other versions14 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 14
- humanlayer/humanlayer★ 13ksame name
- trycompai/crm★ 12ksame name
- fastrepl/anarlog★ 9.9ksame name
- fastrepl/hyprnote★ 9.9ksame name
- mattiacerutti/supernova★ 196same name
- caidanw/skills★ 11same name
- darknightdesigner/skills★ 4same name
- langgenius/mosoo-skills★ 2same name
- CodingCossack/no-use-effect-skill★ 1same name
- GalvinGao/skills★ 1same name
4 more not listed
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository14 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- building-native-uiSkill
- expo-cicd-workflowsSkill
- expo-deploymentSkill
- expo-dev-clientSkill
- hig-components-controlsSkill
- hig-components-dialogsSkill
- hig-components-layoutSkill
- hig-foundationsSkill
- hig-patternsSkill
- native-data-fetchingSkill
- supabase-postgres-best-practicesSkill
- upgrading-expoSkill
The file
We split this skill into the rules it gives an agent
8 rules. 0 are common, 3 are distinctive, and 5 are very specific to this project.
0
Common
Most of the 14 edited versions we read keep these.
3
Distinctive
This author's own choices. Worth a look.
5
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 13
Never import or call useEffect directly in this repo's app code.
- Distinctive: line 15
Use one of these patterns instead:
- Distinctive: line 19
use React Query for async loading and cache invalidation
- Very specific: line 20
use a parent key to force reset/remount behavior
- Very specific: line 21
use useMountEffect from @/hooks/use-mount-effect for true mount-only external sync
- Very specific: line 35
If the work can be expressed with <Stack.Screen options={...} />, do that instead of mutating navigation options in an effect.
- Distinctive: line 39
Do not fetch Supabase data inside mount effects.
- Very specific: line 43
Use useMountEffect only for:
“Common” is measured: kept by at least 6 in 10 of the 14 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Starter integration: root AGENTS.md and docs define the chosen stack and commands. Use Next.js for backend routes and EAS for native builds. Apply platform principles to React Native; do not create an Xcode project or product specification from these examples. Supporting references describe options, not installed capabilities.
No Direct useEffect
Never import or call useEffect directly in this repo's app code.
Use one of these patterns instead:
- derive values during render
- handle work in event callbacks
- use React Query for async loading and cache invalidation
- use a parent
keyto force reset/remount behavior - use
useMountEffectfrom@/hooks/use-mount-effectfor true mount-only external sync
Use This Skill When
- writing a new React component or hook
- reviewing a PR that introduces
useEffect - refactoring existing side effects
- touching auth/session bootstrap
- wiring Expo Router headers or navigation options
Repo-Specific Guidance
Prefer declarative navigation
If the work can be expressed with <Stack.Screen options={...} />, do that instead of mutating navigation options in an effect.
Prefer React Query for data
Do not fetch Supabase data inside mount effects. Database-backed screen data belongs in React Query.
Allowed escape hatch
Use useMountEffect only for:
- subscriptions
- mount/unmount lifecycle integration
- hydration flags
- one-time sync with external systems
Bad reasons:
- mirroring one piece of state into another
- fetching data and calling
setState - using state as a trigger so an effect performs the real action
Replacement Patterns
1. Derive state, do not sync it
// Bad
const [filtered, setFiltered] = useState(items);
useEffect(() => {
setFiltered(items.filter((item) => item.visible));
}, [items]);
// Good
const filtered = items.filter((item) => item.visible);2. Use React Query for async data
const { data } = useQuery({
queryKey: ['records', recordId],
queryFn: () => fetchRecord(recordId),
});3. Use event handlers for user actions
// Bad
const [shouldSave, setShouldSave] = useState(false);
useEffect(() => {
if (shouldSave) saveRecord();
}, [shouldSave]);
// Good
const handleSave = () => {
saveRecord();
};4. Use useMountEffect for real mount-only sync
import { useMountEffect } from '@/hooks/use-mount-effect';
useMountEffect(() => {
const sub = api.subscribe();
return () => sub.unsubscribe();
});5. Reset with key, not effect choreography
<RecordEditor key={recordId} recordId={recordId} />Verify
pnpm lint
pnpm typecheckDoes it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

