4
这是我的阵营组成:如何使这个里面提供渲染功能
constructor(props) {
super(props);
this.state = {
};
this.showChart = this.showChart.bind(this)
}
showChart() {
console.log('test')
}
render() {
{this.showChart} //throws error that, this is undefined
return() (
{this.showChart} //prints test
)
}
现在,如果我想从render()
调用函数,但外界return()
我应该怎么办?
是的你是对的 –
幸福,它帮助你 –