<HocComponent
ref={(ref) => {
this.searchPage = ref;
}}
wrappedComponentRef={(ref) => {
this.searchPageRef = ref;
}}
/>
复制代码
- ref 获取高阶组件实例
- wrappedComponent本身传递的实例
<HocComponent
ref={(ref) => {
this.searchPage = ref;
}}
wrappedComponentRef={(ref) => {
this.searchPageRef = ref;
}}
/>
复制代码
转载于:https://juejin.im/post/5cce635d5188253ffd57420a