Skip to content

Commit

Permalink
chore: Added testID prop to MotiPressable
Browse files Browse the repository at this point in the history
  • Loading branch information
Rohit Agrawal committed Dec 16, 2023
1 parent d4e7ae7 commit 585ca12
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
2 changes: 2 additions & 0 deletions packages/moti/src/interactions/pressable/pressable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ export const MotiPressable = forwardRef<View, MotiPressableProps>(
onFocus,
onBlur,
href,
testID,
} = props

const _hovered = useSharedValue(false)
Expand Down Expand Up @@ -156,6 +157,7 @@ export const MotiPressable = forwardRef<View, MotiPressableProps>(
onPressIn={updateInteraction('pressed', true, onPressIn)}
onPressOut={updateInteraction('pressed', false, onPressOut)}
ref={ref}
testID={testID}
onLayout={onContainerLayout}
// Accessibility props
accessibilityActions={accessibilityActions}
Expand Down
1 change: 1 addition & 0 deletions packages/moti/src/interactions/pressable/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@ export type MotiPressableProps = {
*/
onContainerLayout?: PressableProps['onLayout']
href?: string
testID?: PressableProps['testID']
children?:
| React.ReactNode
| ((
Expand Down

0 comments on commit 585ca12

Please sign in to comment.