-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Fix LegacyPressable
#4016
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
Fix LegacyPressable
#4016
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,6 +1,12 @@ | ||
| import * as React from 'react'; | ||
| import { View } from 'react-native'; | ||
| import { View, ViewProps } from 'react-native'; | ||
|
|
||
| export default React.forwardRef<React.ComponentRef<typeof View>>( | ||
| (props, ref) => <View ref={ref} accessibilityRole="button" {...props} /> | ||
| type ButtonProps = ViewProps & { | ||
| ref?: React.Ref<React.ComponentRef<typeof View>>; | ||
| }; | ||
|
|
||
| export const ButtonComponent = (props: ButtonProps) => ( | ||
| <View accessibilityRole="button" {...props} /> | ||
| ); | ||
|
|
||
|
m-bert marked this conversation as resolved.
|
||
| export default ButtonComponent; | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -19,7 +19,7 @@ import { | |
| StyleProp, | ||
| ViewStyle, | ||
| } from 'react-native'; | ||
| import NativeButton from '../GestureHandlerButton'; | ||
| import { ButtonComponent as NativeButton } from '../GestureHandlerButton'; | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Just a remark, you don't have to change it if you don't think it's necessary: I think it would be sensible to simply change the name of the ButtonComponent to NativeButton. Also after changes in the ../GestureHandlerButton, the Button imported in the v3 version is the wrapped one, thus aliasing it as PureNativeButton seems weird, we can just remove the alias.
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think we can leave it as it is for now and leave those renames for other PRs. This one already grew bigger than I expected 😅 |
||
| import { | ||
| gestureToPressableEvent, | ||
| addInsets, | ||
|
|
||
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.
It is necessary because of #4012