Skip to content

Commit 260c5fa

Browse files
p-sunfacebook-github-bot
authored andcommitted
(Easy) Migrate DatePickerIOS for Bridgeless
Summary: Changelog: [iOS][Internal] Migrate DatePickerIOS for Bridgeless mode Reviewed By: RSNara Differential Revision: D34595944 fbshipit-source-id: b20050dd5b350c186e4d1062c5d796a26d6aeb3e
1 parent 2c268d7 commit 260c5fa

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

React/Views/RCTDatePickerManager.m

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,6 @@
66
*/
77

88
#import "RCTDatePickerManager.h"
9-
10-
#import <React/RCTUIManager.h>
119
#import "RCTBridge.h"
1210
#import "RCTDatePicker.h"
1311
#import "UIView+React.h"
@@ -44,6 +42,8 @@ @implementation RCTConvert (UIDatePicker)
4442

4543
@implementation RCTDatePickerManager
4644

45+
@synthesize viewRegistry_DEPRECATED = _viewRegistry_DEPRECATED;
46+
4747
RCT_EXPORT_MODULE()
4848

4949
- (UIView *)view
@@ -62,16 +62,15 @@ - (UIView *)view
6262

6363
RCT_EXPORT_METHOD(setNativeDate : (nonnull NSNumber *)viewTag toDate : (NSDate *)date)
6464
{
65-
[self.bridge.uiManager addUIBlock:^(RCTUIManager *uiManager, NSDictionary<NSNumber *, UIView *> *viewRegistry) {
66-
UIView *view = viewRegistry[viewTag];
67-
65+
[_viewRegistry_DEPRECATED addUIBlock:^(RCTViewRegistry *viewRegistry) {
66+
UIView *view = [viewRegistry viewForReactTag:viewTag];
6867
if ([view isKindOfClass:[RCTDatePicker class]]) {
6968
[(RCTDatePicker *)view setDate:date];
7069
} else {
7170
// This component is used in Fabric through LegacyInteropLayer.
7271
// `RCTDatePicker` view is subview of `RCTLegacyViewManagerInteropComponentView`.
7372
// `viewTag` passed as parameter to this method is tag of the `RCTLegacyViewManagerInteropComponentView`.
74-
UIView *subview = [uiManager viewForReactTag:viewTag].subviews.firstObject;
73+
UIView *subview = view.subviews.firstObject;
7574
if ([subview isKindOfClass:[RCTDatePicker class]]) {
7675
[(RCTDatePicker *)subview setDate:date];
7776
} else {

0 commit comments

Comments
 (0)