Skip to content

Commit 342041e

Browse files
rshestfacebook-github-bot
authored andcommitted
Fix static view config not to filter out "onClick" events on Android (#41628)
Summary: Pull Request resolved: #41628 # Changelog: Even though `onClick` is used on Android (e.g. via Pressability), the fact of having the handler registered didn't get through to the C++ side on New Architecture, because of being filtered out via the corresponding static view config. As the result, there was no way to know on C++ side whether the corresponding event handler is registered for the view or not. Dynamic updates to the prop also wouldn't correctly propagate to C++, which may be a problem if a view gets e.g. the handler dynamically added. Reviewed By: javache Differential Revision: D51551255 fbshipit-source-id: 0783f5a27c7250f83fb357173bbe5be6213277e5
1 parent b71bb81 commit 342041e

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

packages/react-native/Libraries/NativeComponent/BaseViewConfig.android.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -304,6 +304,7 @@ const validAttributesForEventProps = {
304304
onTouchCancel: true,
305305

306306
// Pointer events
307+
onClick: true,
307308
onPointerEnter: true,
308309
onPointerEnterCapture: true,
309310
onPointerLeave: true,

0 commit comments

Comments
 (0)