Open React hooks distributed as a shadcn custom registry.
The first registry item, lifecycle-effects, installs explicit React 19+
effect hooks into your project's configured hooks directory.
Install directly from the public registry item:
npx shadcn@latest add https://raw.githubusercontent.com/laststance/laststance-hooks/main/public/r/lifecycle-effects.jsonOr register a namespace in components.json:
{
"registries": {
"@laststance-hooks": "https://raw.githubusercontent.com/laststance/laststance-hooks/main/public/r/{name}.json"
}
}Then install by name:
npx shadcn@latest add @laststance-hooks/lifecycle-effectsBefore installing, inspect the exact code payload:
npx shadcn@latest view https://raw.githubusercontent.com/laststance/laststance-hooks/main/public/r/lifecycle-effects.jsonlifecycle-effects adds:
useInitialEffect: mount-only effects.useUpdateEffect: post-mount update effects, with empty deps rejected at the type level.useUnmountEffect: unmount-only cleanup using React 19useEffectEvent.useRenderEffect: every render, or mount plus non-empty dependency changes.useCycleEffect: a semantic alias foruseEffect.
React 19+ is required because useUnmountEffect and useUpdateEffect use
useEffectEvent to call the latest callback without forcing dependency churn.
pnpm install
pnpm registry:build
pnpm registry:check
pnpm typecheck
pnpm validateThe generated registry item lives in public/r/lifecycle-effects.json.
Review that JSON in pull requests because it is the exact payload consumed by
the shadcn CLI.