We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
hox的确灵活轻便,但尝试使用中对于class组件在高阶中无法获取ref, 是否可以为 withModel 函数扩展一个 forwardRef = true 的参数,与 react-redux connect 一致。
withModel
forwardRef = true
react-redux connect
伪代码:
const BasicWrap = ChildComp => { class Basic extends React.Component { constructor(props) { super(props); } componentDidMount() { var name = ChildComp.name; console.log(name) // Wrapper var rf = this.comp; console.log(rf) // undefined } render() { return <ChildComp ref={comp => (this.comp = comp)} {...this.props} />; } } return Basic; }; export default BasicWrap; class Child extends React.Component { constructor(props) { super(props); } render() { // todo... } } const Model = withModel([useUserModel, useOrdersModel], ([user, orders]) => ({ user, orders, }))(Child); export default BasicWrap(Model);
The text was updated successfully, but these errors were encountered:
为 withModel 添加 Config.forwardRef,需求如上,本地 test && build 正常运行,望添加或这边PR,请审阅。
test && build
Sorry, something went wrong.
No branches or pull requests
hox的确灵活轻便,但尝试使用中对于class组件在高阶中无法获取ref, 是否可以为
withModel
函数扩展一个forwardRef = true
的参数,与react-redux connect
一致。伪代码:
The text was updated successfully, but these errors were encountered: