-
-
Notifications
You must be signed in to change notification settings - Fork 1k
Fix Pressable
requiring dimensionsAfterResize
#3606
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
Conversation
packages/react-native-gesture-handler/src/components/Pressable/Pressable.tsx
Show resolved
Hide resolved
@@ -171,6 +171,8 @@ export interface PressableProps | |||
* Defines the dimensions of the Pressable after it's been resized. | |||
* This property does not affect Pressable's physical appearance. | |||
* Required when the Pressable is resized **and** uses pressRetentionOffset. | |||
* | |||
* @deprecated This property is no longer used. It can be safely removed. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we plan to remove it? If so, let's state it right away as this is fairly new prop and I guess most of users have not adapted it yet. Otherwise we could add entry in docs
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We do. I think This property is no longer used.
paints a clear enough picture, but i think it would make sense to remove rest of the prop's description, as the prop is not used for anything anymore.
What do you think?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In that case I'd explicitly state that it will be removed - if we don't there's a chance that people will continue to use it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated the comment as discussed in-person in 8bd8607.
packages/react-native-gesture-handler/src/components/Pressable/PressableProps.tsx
Outdated
Show resolved
Hide resolved
Co-authored-by: Michał Bert <63123542+m-bert@users.noreply.github.com>
Description
The
Pressable
was developed with an incorrect assumption that theonLayout
prop is not available on theNativeButton
.This PR defines the
onLayout
onRawButtonProps
, and makes use of said prop inPressable
to remove the need for thedimensionsAfterResize
property.This PR also marks
dimensionsAfterResize
as deprecated.Fixes #3600
Test plan
Pressable
, despite starting out with0, 0
dimensions, responds correctly to all press events.Pressable
examples in our example app to confirm there are no new issues with the component.Test code