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/nested-propagate-required.md
1---2title: Propagate Prop for Nested AnimatePresence3impact: HIGH4tags: nested, propagate, exit5---67## Propagate Prop for Nested AnimatePresence89Nested AnimatePresence must use propagate prop for coordinated exits.1011**Incorrect (children vanish instantly):**1213```tsx14<AnimatePresence>15{isOpen && (16<motion.div exit={{ opacity: 0 }}>17<AnimatePresence>18{items.map(item => (19<motion.div key={item.id} exit={{ scale: 0 }} />20))}21</AnimatePresence>22</motion.div>23)}24</AnimatePresence>25```2627**Correct (propagate on both):**2829```tsx30<AnimatePresence propagate>31{isOpen && (32<motion.div exit={{ opacity: 0 }}>33<AnimatePresence propagate>34{items.map(item => (35<motion.div key={item.id} exit={{ scale: 0 }} />36))}37</AnimatePresence>38</motion.div>39)}40</AnimatePresence>41```42