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

Closed
@wowsummer

Description

  • 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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions