var AnimationExample=React.createClass({
getInitialState:function(){
return {
position:0
}
},
animationFun:function(){
if(this.state.positionThis is animate! 这是一个简单的js模拟动画,我的疑问是为什么最后要render两次,而render一次不行呢
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号
因为列出的component会根据position属性的变化而更新,第一次render时compoent没有props.position,第二次render后props.position的值为100。