Skip to content

Commit 247d3d2

Browse files
zeyapfacebook-github-bot
authored andcommitted
Allow setting blockNativeResponder on Pressable
Summary: ## Changelog: [General] [Added] - Allow setting blockNativeResponder on Pressable To expose the same prop on Pressability https://github.com/facebook/react-native/blob/b2d9f5f28045fd89bba2dca41274c7cd7abe2ecc/packages/react-native/Libraries/Pressability/Pressability.js#L137 Reviewed By: christophpurrer Differential Revision: D78896178
1 parent 3a833d3 commit 247d3d2

File tree

1 file changed

+9
-0
lines changed
  • packages/react-native/Libraries/Components/Pressable

1 file changed

+9
-0
lines changed

packages/react-native/Libraries/Components/Pressable/Pressable.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,12 @@ type PressableBaseProps = $ReadOnly<{
116116
*/
117117
onPressOut?: ?(event: GestureResponderEvent) => mixed,
118118

119+
/**
120+
* Whether to prevent any other native components from becoming responder
121+
* while this pressable is responder.
122+
*/
123+
blockNativeResponder?: ?boolean,
124+
119125
/**
120126
* Either view styles or a function that receives a boolean reflecting whether
121127
* the component is currently pressed and returns view styles.
@@ -183,6 +189,7 @@ function Pressable({
183189
'aria-expanded': ariaExpanded,
184190
'aria-label': ariaLabel,
185191
'aria-selected': ariaSelected,
192+
blockNativeResponder,
186193
cancelable,
187194
children,
188195
delayHoverIn,
@@ -294,10 +301,12 @@ function Pressable({
294301
onPressOut(event);
295302
}
296303
},
304+
blockNativeResponder,
297305
}),
298306
[
299307
android_disableSound,
300308
android_rippleConfig,
309+
blockNativeResponder,
301310
cancelable,
302311
delayHoverIn,
303312
delayHoverOut,

0 commit comments

Comments
 (0)