vuejs / vuejs/docs

Add VNode type as the first argument of `h`

Open
#2,834 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

state: blocked
Dominant language
Vue
Stars
3.2k
Forks
5k
Avg merge
14d 17h
Merged PRs (30d)
1

Description

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.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the linked h() render-function API page and inspect how the first argument and VNode-related behavior are currently described or typed. Update the h() API reference so a VNode is accepted as the first argument, then verify that the documented signature and example match the behavior described in the issue.

Written by the indexing model from the issue text.

Assessment

Domain
documentation
Issue type
Documentation
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.