为什么每次从父组件传入的props总要存到子组件的state里面呢?
来源:6-10 详情页视频播放控制loading-进度条-重播功能
毛桃_我叫MT
2017-04-12
有什么特殊的要求和规范吗?
class Detail extends Component{ constructor(props) { super(props); this.state = { data: props.data, //here rate:1, muted:true, resizeMode:"contain", repeat:false } } }
比如列表页面下面的详情页。
写回答
2回答
-
游客君
2017-04-24
子组件不能修改自己的props,只能由父组件修改。
00 -
毛桃_我叫MT
提问者
2017-04-12
还有一个问题就是,我的onProgress方法,一直在打印数据。不会停。
042017-04-13
相似问题