You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The child functional component can be attached by this.$refs , or give a warning in development environment when attribute ref is set on a functional component.
What is actually happening?
this.$refs of parent componet is an empty object.
There's a similar issues for React stateless components. A functional component will not actually generate a VueComponent instance, instead of attaching the dom element directly, a warn or an error thrown may be a better choice.
The text was updated successfully, but these errors were encountered:
It doesn't work because you are not passing component's data to the root vnode, which contains ref reference. Simply do return h('p', context.data, 'text');
Version
2.5.2
Reproduction link
https://jsfiddle.net/d2pj7wuo/
Steps to reproduce
Open the JSFiddle link, then check the console.
What is expected?
The child functional component can be attached by
this.$refs
, or give a warning in development environment when attributeref
is set on a functional component.What is actually happening?
this.$refs
of parent componet is an empty object.There's a similar issues for React stateless components. A functional component will not actually generate a VueComponent instance, instead of attaching the dom element directly, a warn or an error thrown may be a better choice.
The text was updated successfully, but these errors were encountered: