Skip to content

Commit 428dd3f

Browse files
haoqunjiangcexbrayat
authored andcommitted
fix(types): use VNodeChild type from vue to avoid breakage
This fixes the test failure in #2233 Vue 3.3.8 added a new type in the `VNodeChildAtom` union type: vuejs/core@405f345#diff-9b2ba253038f7b71dbbbcb545e028d2d51d27d88b041b918c9eb102a83fef189R117 causing incompatiblity with the type defined in this repository. By using types exported from the `vue` package instead of defining our own, we can avoid similar breakges in the future. `VNodeChild` type has been available since 3.0.0-beta.1.
1 parent 446a223 commit 428dd3f

File tree

1 file changed

+3
-10
lines changed

1 file changed

+3
-10
lines changed

src/utils/find.ts

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import {
22
ComponentInternalInstance,
33
VNode,
4+
VNodeChild,
45
VNodeArrayChildren,
56
VNodeNormalizedChildren,
67
VNodeTypes
@@ -92,16 +93,8 @@ export function matches(
9293
* to only keep VNode and VNodeArrayChildren values
9394
* @param value
9495
*/
95-
function nodesAsObject<Node>(
96-
value:
97-
| string
98-
| number
99-
| boolean
100-
| VNodeArrayChildren
101-
| VNode
102-
| null
103-
| undefined
104-
| void
96+
function nodesAsObject(
97+
value: VNodeChild | VNodeArrayChildren
10598
): value is VNodeArrayChildren | VNode {
10699
return !!value && typeof value === 'object'
107100
}

0 commit comments

Comments
 (0)