从ReactJS中的this.props.children获取高度
如何从儿童身上获得身高,作为道具传递?我的意思是:从ReactJS中的this.props.children获取高度,reactjs,Reactjs,如何从儿童身上获得身高,作为道具传递?我的意思是: {this.props.children}//长得高吗? 已解决: this.childElement.offsetHeight//提供高度 (this.childElement=node)}>{children}
{this.props.children}//长得高吗?
已解决:
this.childElement.offsetHeight//提供高度
(this.childElement=node)}>{children}