父元素的方法:
getClusterList = () => {
this.props.setTableData(instance.get('/後臺地址', { params: { pageNum: this.pageNum, pageSize: this.pageSize } }));
}
父元素使用子元素時代碼:
<ClusterEdit clusterId={record.id} ref={(c) => { this.child = c; }} onRef={this.onRef} getClusterList={this.getClusterList}/>
子元素使用時代碼:
this.props.getClusterList();