mirror of
https://github.com/alibaba/lowcode-engine.git
synced 2026-03-10 18:06:02 +00:00
fix: miniapp compwrapper ref
This commit is contained in:
parent
473a06dba9
commit
5ae08f5235
@ -1,4 +1,4 @@
|
|||||||
import { createElement, Component } from 'rax';
|
import { createElement, Component, forwardRef } from 'rax';
|
||||||
|
|
||||||
export default function (Comp) {
|
export default function (Comp) {
|
||||||
class compWrapper extends Component {
|
class compWrapper extends Component {
|
||||||
@ -7,11 +7,15 @@ export default function (Comp) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
|
const { forwardRef } = this.props;
|
||||||
return createElement(Comp, {
|
return createElement(Comp, {
|
||||||
...this.props,
|
...this.props,
|
||||||
|
ref: forwardRef,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return compWrapper;
|
return forwardRef((props, ref) => {
|
||||||
|
return createElement(compWrapper, { ...props, forwardRef: ref });
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user