From 46f68aceb20a10c95c92b5ffeb90f289b015a559 Mon Sep 17 00:00:00 2001 From: HeyImChris <48299693+HeyImChris@users.noreply.github.com> Date: Thu, 3 Mar 2022 18:06:08 -0800 Subject: [PATCH] onDismiss to be an RCTDirectEventBlock (#33222) Summary: We're seeing a red box that `Component 'RCTModalHostView' re-registered bubbling event 'topDismiss' as a direct event moduleConstantsForComponent` in some downstream react-native-macOS builds. Looking at other usage of this object, we treat it as a direct event block everywhere else, just this one spot it's a bubbling event block. It was added with [this PR](https://github.com/facebook/react-native/commit/7bf78eae5e2d53438bc333d3b9995b218f74c84b) which doesn't explicitly address the desire for the prop to bubble up through the view hierarchy or not, so I'm guessing it was just mislabeled and should be direct like the other usages. ## Changelog [iOS] [Bug] - Fix modal redbox for onDismiss Pull Request resolved: https://github.com/facebook/react-native/pull/33222 Test Plan: We don't redbox downstream anymore Reviewed By: p-sun, RSNara Differential Revision: D34628759 Pulled By: philIip fbshipit-source-id: bb3cc78fa43d20808579c614e25716880d002d88 --- React/Views/RCTModalHostView.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/React/Views/RCTModalHostView.h b/React/Views/RCTModalHostView.h index 0246328f99f22f..2fcdcaea83f5b2 100644 --- a/React/Views/RCTModalHostView.h +++ b/React/Views/RCTModalHostView.h @@ -38,7 +38,7 @@ @property (nonatomic, copy) RCTDirectEventBlock onOrientationChange; // Fabric only -@property (nonatomic, copy) RCTBubblingEventBlock onDismiss; +@property (nonatomic, copy) RCTDirectEventBlock onDismiss; - (instancetype)initWithBridge:(RCTBridge *)bridge NS_DESIGNATED_INITIALIZER;