FIG-001/ PRESENCE-DATA

directional exits via usePresenceData.

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.

  • The controls update direction before the keyed slide changes.
  • The slide calls 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.
↩ all examples
api · usePresenceDatamode · popLayout mode · live running source
1
category · presence-data
sheet · sheet 01 / 01
⟳ to re-run