Skip to content

feat: export useIsPresent #384

Open
brince0304 wants to merge 1 commit intonandorojo:masterfrom
brince0304:feat/use-is-present
Open

feat: export useIsPresent #384
brince0304 wants to merge 1 commit intonandorojo:masterfrom
brince0304:feat/use-is-present

Conversation

@brince0304
Copy link

Description

Hi! First of all, thank you for developing and maintaining Moti. I use it extensively in my projects, and it has made working with animations in React Native both powerful and enjoyable.

While working with exit animations and customizing transitions during component mount and unmount, I found that having direct access to the useIsPresent hook is extremely helpful. Currently, Moti exports AnimatePresence from framer-motion, but not useIsPresent. Exporting this hook would allow users to:

  • Detect when a component is present or in the process of exiting
  • Apply fine-grained control to transitions and behaviors based on presence state
  • Simplify advanced animation scenarios without needing to import directly from framer-motion or patch the package locally

I patched my local copy of Moti to export useIsPresent and confirmed that it works as expected. I believe this small change will benefit others who want more control over exit animations.

Summary of Changes

  • Exported useIsPresent from the framer-motion package

Thank you again for your excellent work on this library! If any changes or additional steps are needed, please let me know.

@vercel
Copy link

vercel bot commented Jul 8, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
moti ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jul 8, 2025 1:12am

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant