ZhangTaoK/react-native-marquee-ab

与某些带动效的组件冲突,导致本组件或者其他组件白屏不显示,或者执行动画异常。

Closed this issue · 2 comments

代码
let notifyView = null;
if (this.state.notify && this.state.notify.length > 0) {
this.state.notify.forEach((item,index)=>{
item.value = item.title;
});
notifyView = <MarqueeVertical
textList = {this.state.notify}
width = {screenWidth-100}
height = {40}
direction = {'up'}
numberOfLines = {1}
textStyle = {{fontSize : 13,color : '#222222'}}
onTextClick = {(item) => {
this.props.navigation.navigate('NotifyDetails',{title:'公告',notifyId:item.id});
}}/>;
// notifyView = null;
}
下面调用{notifyView}
功能正常着,就是加上这个我的banner不显示了,sectionList只显示一部分

Originally posted by @pandrawla in #2 (comment)

@pandrawla 你是不是在renderSectionHeader里,对MarqueeVertical或者您的banner进行了setState操作?如果是,请使用async await使数据唯一。renderSectionHeader是无状态的。

请更新最新版本 version 1.2.4

或者可以把您的其他动画和异步的setState用下面代码包裹起来。
setTimeout(() => {
InteractionManager.runAfterInteractions(() => {
..... this.setState({...}) .....
});
},100);