`boolean | null` prop doesn't accept `null` value

This issue has been created since 2022-11-19.

Version

2.7.14

Reproduction link

stackblitz.com

Steps to reproduce

// Comp.vue
defineProps<{ msg: boolean | null }>();
<!-- App.vue -->
<template>
  <Comp :msg="null" />
</template>

What is expected?

No warnings
Vue 3: https://sfc.vuejs.org/#__DEV__eNp9kLtuwzAMRX+F0JIEiKXdcAMU3Tq0BbpqcRzaVWA9QMkpClf/XqrpIw8gmy55eUWeWdyHIA8Tilo0sSMTEkRMU9hoZ2zwlODB2wA9eQsLqYoo9oV2jTr62ckioQ1jm5AVQNOVmbr3/k4LN42jFqC406g/m1iLY35l2yD30TveYC7D+qcRtajhu1Jq/GfRWrylFGKtVOy7ssg+Sk+D4pekySVjUWK01Zb8e0TiYC3WJxmKiwekitDtkJBuZV5Yr3JLbNYu8ym/WC4pwti6gRmUY/j+HfbG4Qv5EJsZGE8NW+9HbB18QuEEebNcnaH9BzvP8Pj6/CRjIuMG038sOWAFOZ9SzV97tqJr

What is actually happening?

Invalid prop type: "null" is not a constructor and Invalid prop: type check failed for prop "msg". Expected Boolean, , got Null warnings

Additional notes

Warnings per se are not the issue, they can be fixed by changing the prop definition to msg?: boolean which also accepts booleans, the issue is that this behaviour is not same as in Vue 3

posva wrote this answer on 2022-11-19

Duplicate of #9358 ?

More Details About Repo
Owner Name vuejs
Repo Name vue
Full Name vuejs/vue
Language TypeScript
Created Date 2013-07-29
Updated Date 2022-12-10
Star Count 201155
Watcher Count 6070
Fork Count 33134
Issue Count 595

YOU MAY BE INTERESTED

Issue Title Created Date Comment Count Updated Date
Wrong code example in object prototype 1 2021-07-22 2022-11-26
Error - Exception: Service Calendar API has not been enabled 5 2022-01-12 2022-09-09
[storage][SSv2] follow up on SSv2 state snapshot version 2 2022-04-13 2022-12-08
Question on copying entire source JSON 4 2020-12-25 2022-11-23
[NEW FEATURE] Native step 1 : Button + Gate + Pipe binary working with pyluos 0 2022-07-26 2022-08-19
Imputing sub-counts given a total count 5 2021-07-06 2022-12-01
Figure out how to hook this PHY together with LiteDRAM 0 2021-07-21 2022-07-10
Karma: Add snapshot testing to dashboard 1 2022-01-26 2022-07-18
mkchromecast fails to find chromecast device 2 2021-04-05 2022-12-03
mkchromecast plays with ~ 15 secs delay on Chromecast Audio 1 2021-01-04 2022-12-03
Tray app cannot select device 2 2021-07-22 2022-12-03
[Bug] Date Time Picker doesn't auto close when clicking outside the component. 0 2022-11-10 2022-12-03
xChangeApi.com support not allowed in Symfony configuration 2 2020-09-07 2022-11-30
xy and wh calculation 1 2022-03-30 2022-11-30
CUDA10.2 import spconv error 6 2021-11-08 2022-11-08
Not able to install 'sharp' module on Windows x64 machine. Platform being recognized as 'android-x64' 2 2021-10-13 2022-11-16
Error generating `erd` with Docker on ARM 3 2022-03-27 2022-12-03
Inconsistent background color in both light and dark theme 5 2022-11-12 2022-12-09
It is not possible to customise ECS task docker command on custom images 0 2022-07-26 2022-11-26
CVE-2022-24130 crashes darktile 0 2022-02-02 2022-11-16
"Show in file browser..." opens the file with its configured application instead of file browser (SpaceFm) 0 2022-11-18 2022-12-09
Typescript Errors during compilation 2 2022-08-19 2022-12-02
/categories endpoint pagination doesn't work 2 2021-05-06 2022-11-29
Remove feature flags from `ConnectorSpecification` 4 2022-11-28 2022-11-23
Adaptive Layer height uses the wrong base layer height to start with 3 2022-05-30 2022-10-21
Update README.md (main) 1 2021-09-03 2022-08-12
Tmod tries to use xbox controller 2 2021-11-15 2022-11-23
Ruby 3.0.1 tar not found 1 2021-04-28 2022-11-16
Pasting specific Light Spheres from the VR Kit into another project causes Error while saving changes 0 2022-08-26 2022-11-29
Add a 'leave' option on team section of a project make it easier to know how to remove yourself from a project 0 2022-08-30 2022-11-29
fix: DirectoryGeneratorTarget using FileConflictResolution.skip never writes files 0 2022-01-19 2022-11-23
With Edge browser 106.0.1370.61 observing timed out after 60 seconds exception and doesn't recover 0 2022-11-06 2022-11-29
**Release:** r-buildpack 1.1.18 2 2021-05-09 2022-12-05
Wrong Permissions of uploaded files 0 2022-08-29 2022-12-01
Cron jobs stop working (Can an error inside the time function result in job stopping?) 7 2021-10-19 2022-11-19
[Question] Inlining worker source with shared modules deduplicated 2 2022-03-29 2022-12-05
Timeout waiting for process kube-apiserver to stop 12 2021-06-29 2022-12-07
On send payment remember previous currency selection 0 2021-03-13 2022-12-05
Add support for Toit Jaguar deployment 1 2021-12-21 2022-11-27
js编译报错需要重新gulp build_dev 1 2017-08-14 2022-11-26
Allow to double click a table row without sending values to the serve function 0 2022-11-18 2022-12-07
[WIIU] Regression: Updating assets.zip fails 10% into extraction. 5 2021-10-26 2022-11-16
[FEATURE REQ] Make the description clearer in aad-starter quick-start 0 2022-11-10 2022-11-06
Broken link for torch.Storage source at the torch.Tensor.storage page 0 2022-02-14 2022-12-01
What's the object ownership model? 5 2021-12-08 2022-11-19
Serverless best practice - LambdaInsideVpc 0 2022-09-21 2022-12-02
Scratch buffer name and dirty status not visible 0 2021-11-13 2022-09-30
Typedef redefinition 2 2021-09-22 2022-12-03
Crash on Location.find() 2 2021-07-14 2022-11-27
[Bug]: Settings overwritten by new development themes 10 2022-07-18 2022-11-11