react-native-navigation的迁移库

RNNReactRootViewCreator.m 498B

1234567891011121314151617181920
  1. #import "RNNReactRootViewCreator.h"
  2. #import "RNN.h"
  3. #import <React/RCTRootView.h>
  4. @implementation RNNReactRootViewCreator
  5. - (UIView*)createRootView:(NSString*)name rootViewId:(NSString*)rootViewId{
  6. if (!rootViewId) {
  7. @throw [NSException exceptionWithName:@"MissingViewId" reason:@"Missing view id" userInfo:nil];
  8. }
  9. UIView *view = [[RCTRootView alloc] initWithBridge:[RNN instance].bridge
  10. moduleName:name
  11. initialProperties:@{@"id": rootViewId}];
  12. return view;
  13. }
  14. @end