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
我目前的解决方案:通过先在当前react组件外包裹一个新的react,在新react组件中处理ref更新问题,然后vue接入新的组件。通过这种方式保证vue接入react组件不需要处理ref。
// 子组件(react): useImperativeHandle( ref, () => ({ query({ selectedWays, rangeTime }) { // ❌异常:当direction, stage在子组件内部变更时,父组件(vue)调用该query拿到的还是初始化的状态 console.log(direction, stage) }, }), [direction, stage] );
// 父组件(vue): <div> <ChildComp ref="childRef" /> </div> handleQuery(curRangeTime, selected) { if (this.$refs.doorRef) { this.$refs.childRef.query({ selectedWays: [...selected], rangeTime: curRangeTime }); } },
Originally posted by @Rmttf in #32 (comment)
The text was updated successfully, but these errors were encountered:
No branches or pull requests
我目前的解决方案:通过先在当前react组件外包裹一个新的react,在新react组件中处理ref更新问题,然后vue接入新的组件。通过这种方式保证vue接入react组件不需要处理ref。
Originally posted by @Rmttf in #32 (comment)
The text was updated successfully, but these errors were encountered: