Framer Motion AnimatePresence: Stale layoutId from Cached Data Prevents Exit Animation
Problem Context AnimatePresence relies on layoutId to match exiting and entering elements for shared‑layout animations. When the layoutId is derived from a value that is cached (for example, a stale item id returned by React Query) and that cached value does not update on subsequent renders, the exit animation can fail to trigger or animate the wrong element