【发布时间】:2016-08-11 06:56:11
【问题描述】:
class MyComponent {
constructor(props){
super(props);
}
render() {
return <View />
}
}
class Test() {
constructor(props){
super(props);
this.onClick = this.onClick.bind(this);
}
onClick() {
this.my.setPorps({
show: true,
});
}
render(){
return <MyComponent ref={ ref => this.my = ref }/>
}
}
如果我触发onClick函数,会导致:
undefined 不是函数(评估 '_this3.progressbar.setProps({ 禁用:true})')
谁能帮帮我?非常感谢!
【问题讨论】:
标签: reactjs react-native ecmascript-6