BlockDex

Components

Registries

Free blocks

Method

BlockDex

Components

Registries

Free blocks

Method

Open API

BlockDex

Components

Registries

Free blocks

Method

Open API

Components/retab-ui/use-keyed-mount-effect

Use Keyed Mount Effect

retab-ui/use-keyed-mount-effect
FreeHook

A key-driven post-commit effect hook for library internals.

Install it

npx shadcn@latest add https://ui.retab.com/r/use-keyed-mount-effect.json

Source

hooks/use-keyed-mount-effect.tsui.retab.com/r/use-keyed-mount-effect.json
1"use client";
2
3import { useEffect } from "react";
4
5/**
6 * Hook variant of <KeyedRunner>. Runs `effect` each time `key` changes
7 * (including the first mount). Returned cleanup runs before the next run
8 * and on unmount. No-ops when `key` is `null`.
9 *
10 * This exists ONLY for library hooks whose internals need reactive
11 * post-commit side effects. Prefer <KeyedRunner> in component code.
12 */
13export function useKeyedMountEffect(
14 key: string | null,
15 effect: () => void | (() => void),
16) {
17 // eslint-disable-next-line no-restricted-syntax
18 useEffect(() => {
19 if (key === null) return;
20 return effect();
21 // The effect closure is intentionally captured at each key change;
22 // eslint's exhaustive-deps would demand we include `effect`, but
23 // the semantics are key-driven, not effect-identity-driven.
24
25 }, [key]);
26}

Files it writes

  • hooks/use-keyed-mount-effect.ts

Facts

Registry
retab-ui
Type
registry:hook
Access
Free
Files written
1
Licence
NOASSERTION
In the index
at or before 2026-08-11
Last confirmed
yesterday

Go to the source

ui.retab.com retab-dev/retab-ui on GitHub Raw registry item This item as JSON

More from retab-ui

All 130 items
Same registry, same kind — the ones you would have found next
ComponentRegistryKindAccessInstallsCommand
Use Keyed Layout Effectuse-keyed-layout-effectretab-uiHooksFreeno deps
Use Mobileuse-mobileretab-uiHooksFreeno deps
Use Mount Effectuse-mount-effectretab-uiHooksFreeno deps

Also from Kynth Studios

Built for the same person as BlockDex

SkillWorks

Claude Code skills and plugins, scored

skillworks.kynth.studio

RuleStack

AGENTS.md gallery and agent-config comparison

rulestack.kynth.studio

ToolDrift

What the AI coding tools changed last night

tooldrift.kynth.studio

The studio list

One product, taken apart, once a month

Kynth Studios pulls one shipped product open every month — what it does, what it cost to build, what the pipeline behind it looks like, and what the numbers did. One email a month, nothing in between.

Double opt-in — we send one confirmation link and nothing else until you click it.

BlockDex

Built by

Kynth Studios

the studio behind SkillWorks, RuleStack and ToolDrift

part of Toolproof, the measurement layer for AI agent tooling

Index

Components
Registries
Method
Open API

Guides

shadcn component libraries
Best shadcn registries
Free shadcn blocks

Reference

Corpus counts
Crawl health
hello@kynth.studio
Privacy
Terms

© 2026 BlockDex. A Kynth Studios product. Changelog

BlockDex

The studio list

One product, taken apart, once a month

Kynth Studios pulls one shipped product open every month — what it does, what it cost to build, what the pipeline behind it looks like, and what the numbers did. One email a month, nothing in between.

Double opt-in — we send one confirmation link and nothing else until you click it.

BlockDex

Built by

Kynth Studios

the studio behind SkillWorks, RuleStack and ToolDrift

part of Toolproof, the measurement layer for AI agent tooling

Index

Components
Registries
Method
Open API

Guides

shadcn component libraries
Best shadcn registries
Free shadcn blocks

Reference

Corpus counts
Crawl health
hello@kynth.studio
Privacy
Terms

© 2026 BlockDex. A Kynth Studios product. Changelog

BlockDex

The studio list

One product, taken apart, once a month

Kynth Studios pulls one shipped product open every month — what it does, what it cost to build, what the pipeline behind it looks like, and what the numbers did. One email a month, nothing in between.

Double opt-in — we send one confirmation link and nothing else until you click it.

BlockDex

Built by

Kynth Studios

the studio behind SkillWorks, RuleStack and ToolDrift

part of Toolproof, the measurement layer for AI agent tooling

Index

Components
Registries
Method
Open API

Guides

shadcn component libraries
Best shadcn registries
Free shadcn blocks

Reference

Corpus counts
Crawl health
hello@kynth.studio
Privacy
Terms

© 2026 BlockDex. A Kynth Studios product. Changelog

BlockDex