作者热门文章
- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我在日志中得到了这个:
RCTBridge required dispatch_sync to load RCTDevLoadingView. This may lead to deadlocks
return(
this.props.lastComponent ?
<CommentList marginLeft={this.props.marginLeft}>
<CommentUserPicWrapper imageWidth={this.props.imageWidth}>
{this.props.imageType === 'URL' ? <CommentUserPic source={{uri:this.props.uri}} imageWidth={this.props.imageWidth} onLoad={this.handleLoad}/> : <CommentUserPic source={require('../../img/defaultProfPic.png')} imageWidth={this.props.imageWidth} onLoad={this.handleLoad}/>}
{
this.state.loading ? null : <ActivityIndicator style={{position:'absolute'}}/>
}
</CommentUserPicWrapper>
<CommentDetails borderStatus={true} marginLeft={this.props.marginLeft}>
<CommentUserName>{this.props.userName} says</CommentUserName>
<CommentUserContent>{this.props.UserContent}</CommentUserContent>
<CommentUserDate><Text>{this.props.commentDate}</Text> at <Text>{this.props.commentTime}</Text>MST</CommentUserDate>
</CommentDetails>
<CommentReply onPress={this.replyClicked} borderStatus={true} underlayColor='transparent'>
<CommentReplyText>Reply</CommentReplyText>
</CommentReply>
</CommentList>
:
<CommentList marginLeft={this.props.marginLeft}>
<CommentUserPicWrapper imageWidth={this.props.imageWidth}>
{this.props.imageType === 'URL' ? <CommentUserPic source={{uri:this.props.uri}} imageWidth={this.props.imageWidth} onLoad={this.handleLoad}/> : <CommentUserPic source={require('../../img/defaultProfPic.png')} imageWidth={this.props.imageWidth} onLoad={this.handleLoad}/>}
{this.state.loading ? null : <ActivityIndicator style={{position:'absolute'}}/>}
</CommentUserPicWrapper>
<CommentDetails borderStatus={this.props.borderStatus} marginLeft={this.props.marginLeft}>
<CommentUserName>{this.props.userName} says</CommentUserName>
<CommentUserContent>{this.props.UserContent}</CommentUserContent>
<CommentUserDate><Text>{this.props.commentDate}</Text> at <Text>{this.props.commentTime}</Text>MST</CommentUserDate>
</CommentDetails>
<CommentReply onPress={this.replyClicked} borderStatus={this.props.borderStatus} underlayColor='transparent'>
<CommentReplyText>Reply</CommentReplyText>
</CommentReply>
</CommentList>
)
最佳答案
我通过更新修复了它 AppDelegate.m
如下:
#if RCT_DEV
#import <React/RCTDevLoadingView.h>
#endif
//...
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
//...
RCTBridge *bridge = [[RCTBridge alloc] initWithBundleURL:jsCodeLocation
moduleProvider:nil
launchOptions:launchOptions];
#if RCT_DEV
[bridge moduleForClass:[RCTDevLoadingView class]];
#endif
RCTRootView *rootView = [[RCTRootView alloc] initWithBridge:bridge
moduleName:@"<AddYourAppNameHere>"
initialProperties:nil];
//...
}
来源:
关于react-native - RCTBridge 需要 dispatch_sync 来加载 RCTDevLoadingView。这可能会导致死锁,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45988103/
java.lang.Throwable 的哪些子类可能被空语句抛出? 通过短语“空语句”,我指的是“无”、“分号”和“分号”: // .... A(); B(); C(); try { //
我是一名优秀的程序员,十分优秀!