1. 通过回调函数
<SomeComponent ref={thisComp => this.yourCompRef = thisComp} />
2. 通过createRef函数
const currentRef = React.createRef();
<SomeComponent ref={currentRef} />
1. 通过回调函数
<SomeComponent ref={thisComp => this.yourCompRef = thisComp} />
2. 通过createRef函数
const currentRef = React.createRef();
<SomeComponent ref={currentRef} />