123456789101112131415161718192021222324252627282930 |
-
- #import "RNNReactRootViewCreator.h"
- #import <React/RCTRootView.h>
-
- @implementation RNNReactRootViewCreator {
- RCTBridge *_bridge;
- }
-
- -(instancetype)initWithBridge:(RCTBridge*)bridge {
- self = [super init];
-
- _bridge = bridge;
-
- return self;
-
- }
-
- - (UIView*)createRootView:(NSString*)name rootViewId:(NSString*)rootViewId {
- if (!rootViewId) {
- @throw [NSException exceptionWithName:@"MissingViewId" reason:@"Missing view id" userInfo:nil];
- }
-
- UIView *view = [[RCTRootView alloc] initWithBridge:_bridge
- moduleName:name
- initialProperties:@{@"id": rootViewId}];
- return view;
- }
-
- @end
|