Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Expose pressable context #18

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Conversation

lanc33llis
Copy link

@lanc33llis lanc33llis commented Jul 29, 2024

We should expose PressableContext so that more complex behavior is possible particularly for child components. This is important because currently the library does not support functions for animate, whileHover, etc. and removes important event handlers from Pressable making it basically impossible for developers to handle state

@jmeistrich
Copy link
Contributor

Thanks @lanc33llis! I'll get this in along with fixing nativewind in an update soon. And what event handlers are missing from Pressable? And how would you like functions for animate and whileHover to work?

I've been deep in a web project and working on legend-state for a while, but I'm coming back to focusing more on our mobile app now so it's a great time to make some improvements here :)

@lanc33llis
Copy link
Author

Ah my apologies! I misread https://github.com/LegendApp/legend-motion/blob/main/src/MotionPressable.tsx, thought the event handlers for pressing/clicks were omitted from the props types so that's all good. Being able to pass functions to animate and such is unnecessary then.

Still may want to expose this context though, might be useful in some custom behavior.

On the note of making improvements, variants would be awesome! This doesn't seem be very difficult besides possibly propagation to child components like motion-framer does. Depending on your timeline for features, I could be able to create a PR for that since that would suit my use cases as well.

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.

2 participants