fix: miniapp compwrapper ref

This commit is contained in:
wanying.jwy 2020-08-24 19:54:58 +08:00
parent 473a06dba9
commit 5ae08f5235

View File

@ -1,4 +1,4 @@
import { createElement, Component } from 'rax';
import { createElement, Component, forwardRef } from 'rax';
export default function (Comp) {
class compWrapper extends Component {
@ -7,11 +7,15 @@ export default function (Comp) {
}
render() {
const { forwardRef } = this.props;
return createElement(Comp, {
...this.props,
ref: forwardRef,
});
}
}
return compWrapper;
return forwardRef((props, ref) => {
return createElement(compWrapper, { ...props, forwardRef: ref });
});
}