【发布时间】:2016-10-17 15:54:27
【问题描述】:
按照示例传递 React Native 的初始属性不起作用。
问题是isSimulator 的值被评估为undefined。
Xcode:
BOOL isSimulator = NO;
#if TARGET_IPHONE_SIMULATOR
isSimulator = YES;
#endif
RCTRootView *rootView = [[RCTRootView alloc] initWithBundleURL:jsCodeLocation
moduleName:@"ReactProject"
initialProperties:@{@"isSimulator": @(isSimulator)}
launchOptions:launchOptions];
反应:
var isSimulator = this.props.isSimulator;
【问题讨论】:
标签: ios xcode react-native prop react-native-ios