Loading source
Pulling the file list, source metadata, and syntax-aware rendering for this listing.
Source from repo
Living wiki of UI design patterns and best practices built with Fumadocs, Next.js, and Base UI components.
Files
Skill
Size
Entrypoint
Format
Open file
Syntax-highlighted preview of this file as included in the skill package.
rules/presence-hook-in-child.md
1---2title: useIsPresent in Child Component3impact: HIGH4tags: presence, hook, component-hierarchy5---67## useIsPresent in Child Component89useIsPresent must be called from child of AnimatePresence, not parent.1011**Incorrect (hook in parent):**1213```tsx14function Parent() {15const isPresent = useIsPresent();16return (17<AnimatePresence>18{show && <Child />}19</AnimatePresence>20);21}22```2324**Correct (hook in child):**2526```tsx27function Child() {28const isPresent = useIsPresent();29return <motion.div data-exiting={!isPresent} />;30}31```32