Skip to content

Commit

Permalink
fix(types): use VNodeChild type from vue to avoid breakage
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
sodatea committed Nov 9, 2023
1 parent 446a223 commit fdb7278
Showing 1 changed file with 3 additions and 10 deletions.
13 changes: 3 additions & 10 deletions src/utils/find.ts
@@ -1,6 +1,7 @@
import {
ComponentInternalInstance,
VNode,
VNodeChild,
VNodeArrayChildren,
VNodeNormalizedChildren,
VNodeTypes
Expand Down Expand Up @@ -92,16 +93,8 @@ export function matches(
* to only keep VNode and VNodeArrayChildren values
* @param value
*/
function nodesAsObject<Node>(
value:
| string
| number
| boolean
| VNodeArrayChildren
| VNode
| null
| undefined
| void
function nodesAsObject(
value: VNodeChild | VNodeArrayChildren
): value is VNodeArrayChildren | VNode {
return !!value && typeof value === 'object'
}
Expand Down

0 comments on commit fdb7278

Please sign in to comment.