Skip to content

Commit

Permalink
onDismiss to be an RCTDirectEventBlock (#33222)
Browse files Browse the repository at this point in the history
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](7bf78ea) 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: #33222

Test Plan: We don't redbox downstream anymore

Reviewed By: p-sun, RSNara

Differential Revision: D34628759

Pulled By: philIip

fbshipit-source-id: bb3cc78fa43d20808579c614e25716880d002d88
  • Loading branch information
HeyImChris authored and facebook-github-bot committed Mar 4, 2022
1 parent 97f3eb2 commit 46f68ac
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion React/Views/RCTModalHostView.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down

0 comments on commit 46f68ac

Please sign in to comment.