VNode.componentInstance is undefined when rendered by a functional component
See original GitHub issueVersion
2.5.17-beta.0 2.5.16
Reproduction link
https://codepen.io/anon/pen/rKwWXq?editors=1010
Steps to reproduce
Open the console
What is expected?
An instance of MyComponent
should be logged
What is actually happening?
undefined
is logged
This worked in 2.5.15
It also works if you change RootComponent
to be non-functional:
const content = h(MyComponent, {}, this.slots.default)
I’m guessing this was caused by 62a922e8, cloneVNode
doesn’t include that property.
Issue Analytics
- State:
- Created 5 years ago
- Reactions:4
- Comments:8 (4 by maintainers)
Top Results From Across the Web
Component instance is undefined - Stack Overflow
Try setTimeout(() => console.log(item.componentInstance), 150) is it still undefind? – Dani R · @Dani R. I checked it. It is mot undefined. But...
Read more >VNode.componentInstance is undefined when rendered by a ...
VNode.componentInstance is undefined when rendered by a functional component.
Read more >Render Functions & JSX | Vue.js
Vue provides an h() function for creating vnodes: js import { h } from 'vue' const ... The render() function has access to...
Read more >https://np.edu/_resources/js/build/wy.bundle.js.map
components /well-yes/wyform.vue?916d","webpack:///components/well-yes/app.vue" ... n\nexport default function normalizeComponent (\n scriptExports,\n render ...
Read more >vue.js - Source code - Greasy Fork
'undefined' ? module.exports = factory() : typeof define === 'function' && define.amd ... generated render function is guaranteed to return Array<VNode>.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Quite an old issue I know… but did you find a solution @sc0Vu ?
@KaelWD Did you solve this issue? The componentInstance is also undefined when I use named slot like:
A component template
B component template
B component script