vuejs / docs

📄 Documentation for Vue 3
https://vuejs.org
Other
2.81k stars 4.1k forks source link

Add VNode type as the first argument of `h` #2834

Open silentmantra opened 3 weeks ago

silentmantra commented 3 weeks ago

https://vuejs.org/api/render-function.html#h

I've tried to pass a vnode as the first argument and additional props, what I expected is that would work and it does. So basically h (when I looked into the code) redirects arguments to cloneVNode. I guess that's a reliable behavior. If so could we include a vnode as a proper type for the first h's argument? The overhead is very small and it sometimes faster just use h if it's already imported.

brc-dd commented 3 weeks ago

Please create an issue at https://github.com/vuejs/core to add the corresponding types first.