loading code fetching the highlighted snippet
The parent passes custom={direction} to AnimatePresence. The keyed child reads that value with usePresenceData() so its enter and exit variants know which way to travel.
direction before the keyed slide changes.usePresenceData(), so it can read parent custom data
while entering and while held for exit.mode="popLayout" lets the leaving slide pop out of layout while the new slide
enters.