Skip to content

Commit 36612a8

Browse files
RSNarafacebook-github-bot
authored andcommitted
Default {bubbling,direct}EventTypes to {} in Native VCs
Summary: ## Rationale **Consistency with Static View Configs:** Static view config will default bubblingEventTypes or directEventTypesto to an empty object, if the any of them are undefined. https://www.internalfb.com/code/fbsource/[a73d46ab4052838e46e0f3aab8508025795aec1f]/xplat/js/react-native-github/Libraries/NativeComponent/ViewConfig.js?lines=20-23%2C26-33%2C41%2C43-50 Changelog: [Internal] Reviewed By: yungsters Differential Revision: D32159393 fbshipit-source-id: fefb3509b9b7c7374d2c3d8962afa5402daf6f72
1 parent 274c617 commit 36612a8

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

Libraries/ReactNative/getNativeComponentAttributes.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,10 @@ function getNativeComponentAttributes(uiViewClassName: string): any {
3535
// native component that can be either avoided or simplified.
3636
let {baseModuleName, bubblingEventTypes, directEventTypes} = viewConfig;
3737
let nativeProps = viewConfig.NativeProps;
38+
39+
bubblingEventTypes = bubblingEventTypes ?? {};
40+
directEventTypes = directEventTypes ?? {};
41+
3842
while (baseModuleName) {
3943
const baseModule = UIManager.getViewManagerConfig(baseModuleName);
4044
if (!baseModule) {

0 commit comments

Comments
 (0)