Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
57c1e67
stepping stone
akwasniewski Jan 7, 2026
342c5f8
update whitelist
akwasniewski Jan 7, 2026
917513e
fix ios hitFrame
akwasniewski Jan 8, 2026
b501a7a
fix ios hitFrame
akwasniewski Jan 8, 2026
6bebb33
merge
akwasniewski Jan 8, 2026
5ef3310
Merge branch 'next' into @akwasniewski/v3-pressable
akwasniewski Jan 9, 2026
0b0b482
fix web!!!!
akwasniewski Jan 13, 2026
ed3b7a4
Revert "merge"
akwasniewski Jan 15, 2026
b11757f
temporary commit
akwasniewski Jan 15, 2026
aec9a15
Merge branch 'next' into @akwasniewski/v3-pressable
akwasniewski Jan 15, 2026
dae4dd9
legacy
akwasniewski Jan 15, 2026
ae6e532
fix export
akwasniewski Jan 16, 2026
f7498bb
remove no longer necessary
akwasniewski Jan 16, 2026
a8788a1
Update packages/react-native-gesture-handler/src/v3/components/Pressa…
akwasniewski Jan 20, 2026
e32ab0c
Merge branch 'next' into @akwasniewski/v3-pressable
akwasniewski Jan 20, 2026
d4b3e0a
simplify if 1
akwasniewski Jan 20, 2026
5d26828
Update packages/react-native-gesture-handler/src/v3/components/Pressa…
akwasniewski Jan 20, 2026
6c6875d
manual activation and comment
akwasniewski Jan 20, 2026
ac68a74
Update packages/react-native-gesture-handler/src/v3/components/Pressa…
akwasniewski Jan 20, 2026
c85289c
update comment
akwasniewski Jan 20, 2026
e5415a2
remove extra view
akwasniewski Jan 20, 2026
07ee909
readd enabled and hitslop
akwasniewski Jan 20, 2026
d94ab44
reduce redundancy
akwasniewski Jan 20, 2026
c5475ab
delete depreacated
akwasniewski Jan 20, 2026
c7ff543
readded test props
akwasniewski Jan 20, 2026
8eabd72
remove 44
akwasniewski Jan 21, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,6 @@ void RNGestureHandlerDetectorShadowNode::layout(LayoutContext layoutContext) {
// TODO: consider allowing more than one child and doing bounding box
react_native_assert(getChildren().size() == 1);

if (!this->yogaNode_.getHasNewLayout()) {
return;
}

auto child = std::static_pointer_cast<const YogaLayoutableShadowNode>(
getChildren()[0]);

Expand All @@ -51,6 +47,7 @@ void RNGestureHandlerDetectorShadowNode::layout(LayoutContext layoutContext) {
// TODO: figure out the correct way to setup metrics between detector and
// the child
auto metrics = child->getLayoutMetrics();
metrics.frame = child->getLayoutMetrics().frame;
setLayoutMetrics(metrics);

auto childmetrics = child->getLayoutMetrics();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ import { GestureObjects as Gesture } from '../../handlers/gestures/gestureObject
import { GestureDetector } from '../../handlers/gestures/GestureDetector';
import {
PressableEvent,
PressableProps,
PressableDimensions,
LegacyPressableProps,
} from './PressableProps';
import {
Insets,
Expand Down Expand Up @@ -40,7 +40,7 @@ import { PressableStateMachine } from './StateMachine';
const DEFAULT_LONG_PRESS_DURATION = 500;
const IS_TEST_ENV = isTestEnv();

const Pressable = (props: PressableProps) => {
const Pressable = (props: LegacyPressableProps) => {
const {
testOnly_pressed,
hitSlop,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import {
View,
} from 'react-native';
import { RelationPropType } from '../utils';
import { AnyGesture } from '../../v3/types';

export type PressableDimensions = { width: number; height: number };

Expand All @@ -30,7 +31,47 @@ export type InnerPressableEvent = {

export type PressableEvent = { nativeEvent: InnerPressableEvent };

export interface PressableProps
export interface LegacyPressableProps extends CommonPressableProps {
/**
* A gesture object or an array of gesture objects containing the configuration and callbacks to be
* used with the Pressable's gesture handlers.
*/
simultaneousWithExternalGesture?: RelationPropType;

/**
* A gesture object or an array of gesture objects containing the configuration and callbacks to be
* used with the Pressable's gesture handlers.
*/
requireExternalGestureToFail?: RelationPropType;

/**
* A gesture object or an array of gesture objects containing the configuration and callbacks to be
* used with the Pressable's gesture handlers.
*/
blocksExternalGesture?: RelationPropType;
}

export interface PressableProps extends CommonPressableProps {
/**
* A gesture object or an array of gesture objects containing the configuration and callbacks to be
* used with the Pressable's gesture handlers.
*/
simultaneousWith?: AnyGesture;

/**
* A gesture object or an array of gesture objects containing the configuration and callbacks to be
* used with the Pressable's gesture handlers.
*/
requireToFail?: AnyGesture;

/**
* A gesture object or an array of gesture objects containing the configuration and callbacks to be
* used with the Pressable's gesture handlers.
*/
block?: AnyGesture;
}

interface CommonPressableProps
extends AccessibilityProps,
Omit<ViewProps, 'children' | 'style' | 'hitSlop'> {
/**
Expand Down Expand Up @@ -149,24 +190,6 @@ export interface PressableProps
*/
unstable_pressDelay?: number;

/**
* A gesture object or an array of gesture objects containing the configuration and callbacks to be
* used with the Pressable's gesture handlers.
*/
simultaneousWithExternalGesture?: RelationPropType;

/**
* A gesture object or an array of gesture objects containing the configuration and callbacks to be
* used with the Pressable's gesture handlers.
*/
requireExternalGestureToFail?: RelationPropType;

/**
* A gesture object or an array of gesture objects containing the configuration and callbacks to be
* used with the Pressable's gesture handlers.
*/
blocksExternalGesture?: RelationPropType;

/**
* @deprecated This property is no longer used, and will be removed in the future.
*/
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
export type {
LegacyPressableProps,
PressableProps,
PressableStateCallbackType,
} from './PressableProps';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import {
InnerPressableEvent,
PressableEvent,
} from './PressableProps';
import { HoverGestureEvent, LongPressGestureEvent } from '../../v3';

const numberAsInset = (value: number): Insets => ({
left: value,
Expand Down Expand Up @@ -45,9 +46,12 @@ const touchDataToPressEvent = (
});

const gestureToPressEvent = (
event: GestureStateChangeEvent<
HoverGestureHandlerEventPayload | LongPressGestureHandlerEventPayload
>,
event:
| GestureStateChangeEvent<
HoverGestureHandlerEventPayload | LongPressGestureHandlerEventPayload
>
| HoverGestureEvent
| LongPressGestureEvent,
timestamp: number,
targetId: number
): InnerPressableEvent => ({
Expand All @@ -73,9 +77,12 @@ const isTouchWithinInset = (
(touch?.locationY ?? 0) > -(inset.top ?? 0);

const gestureToPressableEvent = (
event: GestureStateChangeEvent<
HoverGestureHandlerEventPayload | LongPressGestureHandlerEventPayload
>
event:
| GestureStateChangeEvent<
HoverGestureHandlerEventPayload | LongPressGestureHandlerEventPayload
>
| HoverGestureEvent
| LongPressGestureEvent
): PressableEvent => {
const timestamp = Date.now();

Expand Down
3 changes: 2 additions & 1 deletion packages/react-native-gesture-handler/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -148,9 +148,10 @@ export type {

export type {
PressableProps,
LegacyPressableProps,
PressableStateCallbackType,
} from './components/Pressable';
export { default as Pressable } from './components/Pressable';
export { default as LegacyPressable } from './components/Pressable';

export type { GestureTouchEvent as SingleGestureTouchEvent } from './handlers/gestureHandlerCommon';

Expand Down
Loading
Loading