Skip to content

Commit 485b1ac

Browse files
committed
refactor: add comments
1 parent 1c65bf7 commit 485b1ac

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/stubs.ts

+4
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,10 @@ const isComponent = (args: VNodeArgs) => typeof args[0] === 'object'
4747

4848
export function stubComponents(stubs: Record<any, any>) {
4949
transformVNodeArgs((args) => {
50+
// args[0] can either be:
51+
// 1. a HTML tag (div, span...)
52+
// 2. An object of component options, such as { name: 'foo', render: [Function], props: {...} }
53+
// Depending what it is, we do different things.
5054
if (isHTMLElement(args) || isCommentOrFragment(args) || isParent(args)) {
5155
return args
5256
}

0 commit comments

Comments
 (0)