Fix React 18.3 ref warning

Fixed a spurious React 18.3 warning about `ref` not being a prop in AnimatePresence when not using popLayout mode. The component was unconditionally reading a ref property that triggered a warning getter, even though the ref wasn't needed in that mode.