Skip to content

Commit

Permalink
fix(compiler-sfc): fix props destructing default value type checking …
Browse files Browse the repository at this point in the history
…with unresolved type (#8340)

close #8326
  • Loading branch information
kalvenschraut authored May 17, 2023
1 parent 216f269 commit f69dbab
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions packages/compiler-sfc/src/script/defineProps.ts
Original file line number Diff line number Diff line change
Expand Up @@ -311,11 +311,7 @@ function genDestructuredDefaultValue(
const value = ctx.getString(defaultVal)
const unwrapped = unwrapTSNode(defaultVal)

if (
inferredType &&
inferredType.length &&
!inferredType.includes(UNKNOWN_TYPE)
) {
if (inferredType && inferredType.length && !inferredType.includes('null')) {
const valueType = inferValueType(unwrapped)
if (valueType && !inferredType.includes(valueType)) {
ctx.error(
Expand Down

0 comments on commit f69dbab

Please sign in to comment.