mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
5dbd62c7ff
Summary: LegacyViewManagerInterop layer can now handle events as well. We expose `eventInterceptor` from `NSComponentData`, that way we can hook into event dispatching that happens within `NSComponentData`. Coordinator has a map of `UIView -> reactTag` which it uses to figure out to which component view to forward the event. New `LegacyViewManagerInteropViewEventEmitter` exposes APIs to send `folly::dynamic` to javascript. Reviewed By: shergin Differential Revision: D17765834 fbshipit-source-id: 25e75e445b32c69ec9ab0189c4ab7fba5f8c7b5d
37 lines
1.2 KiB
Objective-C
37 lines
1.2 KiB
Objective-C
/**
|
|
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
*
|
|
* This source code is licensed under the MIT license found in the
|
|
* LICENSE file in the root directory of this source tree.
|
|
*/
|
|
|
|
#import <Foundation/Foundation.h>
|
|
|
|
#import <React/RCTComponent.h>
|
|
#import <React/RCTDefines.h>
|
|
#import <React/RCTViewManager.h>
|
|
|
|
@class RCTBridge;
|
|
@class RCTShadowView;
|
|
@class UIView;
|
|
|
|
@interface RCTComponentData : NSObject
|
|
|
|
@property (nonatomic, readonly) Class managerClass;
|
|
@property (nonatomic, copy, readonly) NSString *name;
|
|
@property (nonatomic, weak, readonly) RCTViewManager *manager;
|
|
|
|
- (instancetype)initWithManagerClass:(Class)managerClass
|
|
bridge:(RCTBridge *)bridge NS_DESIGNATED_INITIALIZER;
|
|
|
|
- (UIView *)createViewWithTag:(NSNumber *)tag;
|
|
- (RCTShadowView *)createShadowViewWithTag:(NSNumber *)tag;
|
|
- (void)setProps:(NSDictionary<NSString *, id> *)props forView:(id<RCTComponent>)view;
|
|
- (void)setProps:(NSDictionary<NSString *, id> *)props forShadowView:(RCTShadowView *)shadowView;
|
|
|
|
@property (nonatomic, copy, nullable) void (^eventInterceptor)(NSString *eventName, NSDictionary *event, id sender);
|
|
|
|
- (NSDictionary<NSString *, id> *)viewConfig;
|
|
|
|
@end
|