Skip to content

Missing ref owner context. ref cannot be used on hoisted vnodes. A vnode with ref must be created inside the render function #7273

New issue

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

Closed
1 task
wowsummer opened this issue Jan 12, 2024 · 3 comments

Comments

@wowsummer
Copy link

  • I have searched the issues of this repository and believe that this is not a duplicate.

Version

4.1.0

Environment

4.1.0

Reproduction link

https://www.antdv.com/components/message-cn

Steps to reproduce

调用官方 message 示例,控制台警告:Missing ref owner context. ref cannot be used on hoisted vnodes. A vnode with ref must be created inside the render function

Display normal message <script lang="ts" setup> import { message } from 'ant-design-vue'; const [messageApi, contextHolder] = message.useMessage();

const info = () => {
messageApi.info('Hello, Ant Design Vue!');
};
</script>

What is expected?

不要警告

What is actually happening?

警告:Missing ref owner context. ref cannot be used on hoisted vnodes. A vnode with ref must be created inside the render function

@selicens
Copy link
Member

update 4.1.1

@MrMa98
Copy link

MrMa98 commented Jan 31, 2024

更新4.1.1

更新4.1.2也有同样的问题,只能舍弃[Hooks 调用]用open

Copy link

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jan 31, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants